3 ms·
Do you have any more specific examples where it has caused a problem not having int type specifically? I can't really remember having a problem with it myself,
by mewpmewp2 2y ago
Do you have any more specific examples where it has caused a problem not having int type specifically?
I can't really remember having a problem with it myself, but maybe your usecases are different.
- leononame 2y agoNot really. In my parent comment I tried to make clear that it's not a limitation for me in real-world scenarios I encounter, but still something I feel like being a potential class of problems that could be so easily solved. When I really needed dedicated integer types of a specific size, e.g. for encoding/decoding some binary data, so far I've been successful using something like Uint8Array
- throwanem 2y agoSound currency arithmetic is a lot harder when you have to constantly watch out for the accidental introduction of a fractional part that the type system can't warn you about, and that can never be safe with IEEE 754 floats. (This doesn't just bite in and near finance: go use floating-point math to compute sales tax, you'll find out soon enough what I mean.) Bigints solve that problem, but can't be natively represented by JSON, so there tends to be a lot of resistance to their use.
- baq 2y agoI’m converting a billing system from js to ts right now. Looking for a therapist.