3 ms·
> Doing currency manipulation using with i32 as an example for developers of a language that only supports float. What can go wrong? Using i32 for currency cal
by kybernetikos 6y ago
> Doing currency manipulation using with i32 as an example for developers of a language that only supports float. What can go wrong?
Using i32 for currency calculations is probably a bad idea (although there are situations where it would be OK), but this has absolutely nothing to do with javascript - it's no worse in js than it is in rust, since javascript fully supports all i32 numbers. In fact, it has a number of bitwise operators that operate on i32 numbers, and a bitwise operator that even works on u32 numbers.