4 ms·
Because when asked if (9999999999999999 == 10000000000000000), they return true.
by slowmotiony 10y ago
Because when asked if (9999999999999999 == 10000000000000000), they return true.
- tscs37 10y agoThis is why types are nice. In Javascript you're not ensured to have an error, your program might continue working based on wrong data because some type has been randomly converted to a float. In Go or C# you'd get an overflow error if the type is an int or you know it's a float and you get inaccuracy, if you need the accuracy you use a decimal type which will also ensure that any result is always of it's type. Typed languages mean I cannot loose data accuracy without explicitly doing so. I have to tell Go that I want this uint64 as uint8 otherwise it's an error.