If I have two arbitrary double precision floating point numbers A and B, where A is <= B, is there a way to determine whether the range A to B can be divided into N evenly spread (ignoring rounding errors) double precision floating point numbers between A and B that are distinct and respect strict total < ordering, with the value of each step being A+(B - A)/(N+1)*X where X = [1...N]? Example:
A=0
B=1
N=5
Result: [0, 1/6, 2/6, 3/6, 4/6, 5/6, 1]
In this case it's obvious that each of these numbers "fits" and we don't have to worry about loss of precision / rounding errors causing < ordering to be violated. But if A=0 and B=0.000000000001 it's far less obvious that this is "safe", since even if there is enough "space" to represent N additional values between A and B, it's not clear if rounding errors in the calculation of A+(B - A)/(N+1)*X could result in values that do not respect strict total < ordering.
I'm aware of "What Every Computer Scientist Should Know About Floating-Point Arithmetic", but it's particularly dense and hard to transform into higher level takeaways like this. I'm hoping for a robust answer, but am willing to concede with a "practical" answer, e.g. maybe I should just ensure that (B-A)/N is always greater than some threshold like 0.01.