Skip to content
Advertisement

Tag: bigint

Assigning BigInt stores wrong number (number+1)

I want to define a BigInt number in JavaScript. But when I assign it, the wrong number is stored. In fact 1 is added to the number when storing. So the number stored is 1152921504606846976, but it should be 11529215046068469765. Why is that? Answer Converting a Number to a BigInt can’t create bits that weren’t there before. 0b1 (just like

How can I handle long Int with GraphQL?

As you know that GraphQL has no data type like long int. So, whenever the number is something big like 10000000000, it throws an error like this: Int cannot represent non 32-bit signed integer value: 1000000000000 For that I know two solutions: Use scalars. Use apollo-type-bigint package. Both of those solutions convert the big int to string, and I’d rather

Advertisement