What is the max value of integer in dart?

后端 未结 2 1917
猫巷女王i
猫巷女王i 2021-02-20 05:42

I have looked everywhere but I couldnt find any information related to this topic. Also, Is there a java - like Long / BigDecimal datatype in dart?

2条回答
  •  孤街浪徒
    2021-02-20 05:48

    Dart 2

    For dart2js generated JavaScript Pixel Elephants answer is still true.

    within the range -253 to 253

    Other execution platforms have fixed-size integers with 64 bits.

    The type BigInt was added to typed_data

    Since Dart 2.0 will switch to fixed-size integers, we also added a BigInt class to the typed_data library. Developers targeting dart2js can use this class as well. The BigInt class is not implementing num, and is completely independent of the num hierarchy.

    Dart 1

    There are also the packages
    - https://pub.dartlang.org/packages/bignum
    - https://pub.dartlang.org/packages/decimal

提交回复
热议问题