3 ms·
Can we fix the numeric types next? Having the integer types and decimal types would resolve a whole lot of issues.
by radicalbyte 2y ago
Can we fix the numeric types next? Having the integer types and decimal types would resolve a whole lot of issues.
- jitl 2y agoI can’t remember wishing I had int32 or uint8 if that’s what you mean. Not having int64 or int128 is kind of annoying but bigint fills in there fine.
- SushiHippie 2y agoI think they mean splitting the "Number" [0] type into an integer type and a decimal type. Currently the "Number" type is used for every number and it gets stored as a double, and can "only" represent "integers" safely in the range of ±(2^53 -1). Though there is a "BigInt" [1] type. [0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data... [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#bigint_type https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data...
- radicalbyte 2y agoMainly: * Integer types of various sizes (for efficiency) and so you don't have to constantly do floating point comparisons (i.e. equal within a small delta) and generally have better compatibility with other languages. * Decimal floating point type so you can work in base-10 and don't have rounding issues. Plus all of the error checking you get for free if you're using typescript instead of raw-dogging it with plain javascript or coffee-script :-)