4 ms·
I don't think it's that strange. It's a scientific notation with the signed exponent around 0, so (barring special cases like NaN and infinite), it will be div
by Taywee 3y ago
I don't think it's that strange. It's a scientific notation with the signed exponent around 0, so (barring special cases like NaN and infinite), it will be divided roughly in half around the pivot of 2^0 for both signs.
- magicalhippo 3y agoSurely this was by design? At least when solving physics problems, you'll frequently scale the equations so the actual values in the problem are around -1..1. Thus having extra precision around -1..1 when solving such problems would be beneficial. For example, if you're trying to solve the motion of a mass on a spring that gets an initial kick, rather than representing the spring length in meters, you divide by some characteristic length[1] and get a non-dimensional length of order 1. If you want the actual length, you just multiply the non-dimensional length by the characteristic length. [1]: https://hplgit.github.io/scaling-book/doc/pub/book/html/._scaling-book2006.html https://hplgit.github.io/scaling-book/doc/pub/book/html/._sc...
- moralestapia 3y ago>Surely this was by design? It is indeed, and one of the first things you learn in scientific computing is to make your values fit mostly within [-1, 1].
- sampo 3y ago> Thus having extra precision around -1..1 when solving such problems would be beneficial. Floating point numbers have the same precision (relative precision) everywhere.
- deleted 3y ago[deleted]
- skellington 3y agoYeah it can be hard to internalize what this means and when it matters, but basically you get about 7 decimal places of precision regardless of the numbers size. So between [-1, 1] you can represent a number like 0.1234567 and then 0.1234568 for a min delta of 0.000001. But around a billion, you can only represent 1,234,567,000 and then 1,234,568,000 for a min delta of 1000. These are not exactly right numbers, just rough estimates to get the idea, but the point is if you are trying to do something like add 1 centimeter to a position that is 10,000 kilometers from an origin, you're adding 0, no matter how many times you do it, it will never increment.
- magicalhippo 3y agoRight, but my point is that you scale the physics problems because it makes them more general. In my example, if you changed the length of the spring you don't have to recalculate the whole solution, you just calculate the new characteristic length for your new spring length and "undo" the scaling with this new characteristic length using the previously computed solution. Thus, since you know a lot of problems will have values around order 1 it makes sense to design the encoding such that you get extra absolute precision for order 1 numbers.