Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 454 Bytes

no-division.md

File metadata and controls

24 lines (16 loc) · 454 Bytes

Disallow division

Same as no-float-calculation rule, integer operations may also produce decimals with wrong accuracy (e.g. 14 / 100 / 100), so division should be disallowed by default in integer operations.

Fail

1 / 2
1 / 2 / 3

'1' / '2'
'1' / '2' / '3'

0.1 / 0.2
'0.1' / '0.2'

amount / 1
1 / amount
amount / count

Pass

All scenarios that do not contain a divisor can be passed through the lint.