0

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
    what type of float? for double the distance between representable numbers starts with 2.220446049250313080847263336181640625e-16 from 1 to 2 and ends with 1.7763568394002504646778106689453125e-15 from 8 to 12. – Lutz Lehmann Sep 25 '16 at 09:10
  • @LutzL let's say it's octal float point system with precision of 2 or could be just decimal – Square-root Sep 25 '16 at 16:57
  • 1
    The sense of "spacing" is still not clear. If you want the question to reopen and get answers, you need to add context to the question, for instance, what the "spacing" is to be used for. – Lutz Lehmann Sep 25 '16 at 17:08
  • I did some update @LutzL – Square-root Sep 26 '16 at 05:59
  • 1
    That is looking right with sufficient information on the type of floats. – Lutz Lehmann Sep 26 '16 at 06:24

1 Answers1

1

"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