Flutter for Beginners
上QQ阅读APP看书,第一时间看更新

Numbers

Dart represents numbers in two ways:

  • Int: 64-bit signed non-fractional integer values such as -263 to 263-1.
  • Double: Dart represents fractional numeric values with a 64-bit double-precision floating-point number.

Both of them extend the num type. Additionally, we have many handy functions in the dart:math library to help with calculations.

In JavaScript, numbers are compiled to JavaScript Numbers, and allow the values -2 53 to 2 53-1.

Additionally, note that numdouble, and int types cannot be extended or implemented.