Big integer, Big float, and operator overloading ideas

Fabrice Bellard fabrice at
Mon May 28 11:25:33 UTC 2018

A new revised version of the "BigNum extensions" is available at . This new version is 100% compatible 
with standard Javascript with the addition of a "use bigint" mode. It is 
split into 4 proposals:

1) Overloading of the standard operators to support new types such as 
complex numbers, fractions or matrixes.

2) Bigint mode where arbitrarily large integers are available by default 
(no "n" suffix is necessary as in the BigInt proposal at ).

3) Arbitrarily large floating point numbers in base 2 using the IEEE 754 

4) Optional "math" mode which modifies the semantics of the division, 
modulo and power operator. The division and power operator return a 
fraction with integer operands and the modulo operator is defined as the 
Euclidian remainder.

A complete demo is available at . The command "\mode 
[std|bigint|math]" can be used to switch between the standard javascript 
mode, bigint mode or math mode. In standard Javascript mode, the 
complete TC39 BigInt proposal is supported. In the demo, the default
floating point precision is set to 128 bits. It can be set back to the 
default Javascript precision with "\p f64" or "\p 53 11".


More information about the es-discuss mailing list