Skip to content

Files

Latest commit

 

History

History
29 lines (22 loc) · 528 Bytes

prefer_int_literals.md

File metadata and controls

29 lines (22 loc) · 528 Bytes

Pattern: Missing use of int literal

Issue: -

Description

DO use int literals rather than the corresponding double literal.

Example of incorrect code:

const double myDouble = 8.0;
final anotherDouble = myDouble + 7.0e2;
main() {
 someMethod(6.0);
}

Example of correct code:

const double myDouble = 8;
final anotherDouble = myDouble + 700;
main() {
 someMethod(6);
}

Further Reading