Express highest floating point quantity that is less than 1
- by edA-qa mort-ora-y
I was doing some rounding calculations and happened upon a question. How can I express the highest quantity less than 1 for a given floating point type?
That is, how I write/represent value x such that x < 1, x + y >= 1 for any y > 0.
In fractions this would be x = (q-1)/q where q is the precision of the type. For example, if you are…