With .NET 8.0 supporting 128 bit integers as Int128 and Uint128 (here),
How can this be possibly be handled in browsers?
[UPDATE]
I have two things primarily on my mind:
One, how possibly these can be handled in arithmetic calcs in browser (one of my earlier projects involved statistical analyses in JS in browser), and
Two, if .NET is providing these datatypes, what is the purpose and what most common adjacent building blocks/techs can possibly handle them.
Javascript has at least two build-in types applicable here. If you are ok with precision loss then you can go with
Number(The JavaScriptNumbertype is a double-precision 64-bit binary format IEEE 754 value, like double in Java or C#), otherwise you need to look into usingBigIntor some custom type.Difference between
NumberandBigInt:JSON has a single "direct" node type for numbers and does not distinguish between number types, by default
JSON.parsewill useNumberso you can encounter aforementioned precision loss in case of big numbers, in this case you can look into using some workarounds likejson-bigintlibrary or solution from this answer .