I've read a lot about floats, but it's all unnecessarily involved. I think I've got it pretty much understood, but there's just one thing I'd like to know for sure:
I know that, fractions of the form 1/pow(2,n)
, with n
an integer, can be represented exactly in floating point numbers. This means that if I add 1/32
to itself 32 million times, I would get exactly 1,000,000
.
What about something like 1/(32+16)
? It's one over the sum of two powers of two, does this work? Or is it 1/32+1/16
that works? This is where I'm confused, so if anyone could clarify that for me I would appreciate it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…