Chrome 68 supports BigInt and also Node.js v10 supports it with --harmony-bigint flag. But console.log doesn't support BigInt in them.
Chrome 68
> console.log("%d", 1180591620717411303424n)
NaN
> console.log("%i", 1180591620717411303424n)
NaN
Node.js v10.7.0 with --harmony-bigint
> console.log("%d", 1180591620717411303424n)
1.1805916207174113e+21
> console.log("%i", 1180591620717411303424n)
1.1805916207174113e+21
I think expected result is
> console.log("%d", 1180591620717411303424n)
1180591620717411303424n
> console.log("%i", 1180591620717411303424n)
1180591620717411303424n
However, spec shows %d or %i uses %parseInt%(element, 10) for type conversion.
What specifier is the best for BigInt? Has this already been discussing?
Chrome 68 supports BigInt and also Node.js v10 supports it with
--harmony-bigintflag. But console.log doesn't support BigInt in them.Chrome 68
Node.js v10.7.0 with
--harmony-bigintI think expected result is
However, spec shows
%d or %iuses%parseInt%(element, 10)for type conversion.What specifier is the best for BigInt? Has this already been discussing?