Documentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
BigInt is a built-in Dart class representing an arbitrarily large integer. Unlike the standard int type, which is constrained to a 64-bit two’s complement representation (ranging from -2^63 to 2^63 - 1), BigInt can store integer values of any size, limited only by the available system memory.
Instantiation
Because Dart’s numeric literals are parsed as 64-bit integers by the compiler, instantiating aBigInt that exceeds the 64-bit limit requires parsing from a String. Using BigInt.from() with a numeric literal that exceeds the 64-bit limit results in a compile-time error.
Operators
BigInt overloads standard arithmetic, relational, and bitwise operators. This allows instances to be manipulated using the same syntax as native int types.
/) is fully supported between BigInt instances, but it evaluates to a double. To maintain arbitrary precision and return a BigInt, use the truncating division operator (~/).
Key Properties and Methods
BigInt provides several properties and methods for mathematical operations and state inspection.
Technical Characteristics
- Immutability: Instances of
BigIntare strictly immutable. All arithmetic and bitwise operations allocate and return a newBigIntinstance in memory. - Performance Overhead: Because
BigIntutilizes software-based arbitrary-precision arithmetic rather than hardware-level CPU instructions, operations are significantly slower and consume more memory than nativeintoperations. - Web Compilation: When compiled to the web via
dart2jsordartdevc(DDC), Dart’sBigIntuses a custom Dart implementation (a class backed by arrays of smaller integers) to guarantee consistent semantics with the Dart VM. It does not map to the native JavaScriptBigInttype. Native JS BigInts are instead accessed via JS interop (e.g.,JSBigInt).
Master Dart with Deep Grasping Methodology!Learn More





