spacing between float numbers in a range?

594 Views Asked by At

So i'm trying to find the spacing of float numbers in decimal in the range let's say for example [1,12)

Is it as simple as something like 12-1 = 11

if not, then how?

1

There are 1 best solutions below

0
On

"All floating point numbers with exponent equal to t are in the interval [b^(t-1), b^t). In this interval there are exactly (b-1)*b^(k-1) distinct floating point numbers and they are equally spaced. The distance between any 2 consecutive numbers is: b^(t-k)"

According to the above finding spacing between octal floating numbers with precision k = 2 and a decimal interval [512,4096)

would be like (8-1)*8^(2-1) = 56 distinct numbers

Distance/Spacing = 8^(3-2) = 8