How many floating-point numbers are in the interval [0,1]?
1–10 of 158 posts
Re: How many floating-point numbers are in the interval [0,1]?
#2I'm the kind of person who understands floats by looking at the underlying bit patterns, and nextafter makes it easy to traverse the integers.
Re: How many floating-point numbers are in the interval [0,1]?
#3Re: How many floating-point numbers are in the interval [0,1]?
#4Re: How many floating-point numbers are in the interval [0,1]?
#5What about nan? The test '!(x 1)' will say yes, while 'x >= 0 && x Or -0 for that matter.
Re: How many floating-point numbers are in the interval [0,1]?
#6Quick Java program says 1,065,353,216 / 1,065,353,217
Which one is right? Or are Java floats just "different"?
static {
float a = 0;
long count = 0;
while (a Re: How many floating-point numbers are in the interval [0,1]?
#7Article says 1,056,964,609 / 1,056,964,610 Quick Java program says 1,065,353,216 / 1,065,353,217 Which one is right? Or are Java floats just "different"? static { float a = 0; long count = 0; while (a
Re: How many floating-point numbers are in the interval [0,1]?
#8Many people think floating point numbers are magically precise. They're not. They're far more accurate at lower magnitudes and precision fades as you work with larger values.
Re: How many floating-point numbers are in the interval [0,1]?
#9A clearer way to phrase the question might be: "How many floating-point numbers between 0 and 1 can be generated without duplicates?"
Re: How many floating-point numbers are in the interval [0,1]?
#10Article says 1,056,964,609 / 1,056,964,610 Quick Java program says 1,065,353,216 / 1,065,353,217 Which one is right? Or are Java floats just "different"? static { float a = 0; long count = 0; while (a