Numbers

Integers and doubles are both number types, which means that both support many of the same methods and operators. Dart numbers work pretty much like they do in many other languages.

primitives/numbers.dart
 
2 + 2; ​// 4
 
2.2 + 2; ​// 4.2
 
2 + 2.2; ​// 4.2
 
2.2 + 2.2; ​// 4.4

As you can see, Dart numbers do “the right thing” when mixing them in operations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.170.223