infinite loop that isnt infinite?
i was playing around with c++ recently and for laughs and giggles i came up with this little program
Code:
#include <iostream> just wondering if even though in theory this should be an infinite loop (a number repetedly divided by 2 should never reach 0 thus the conditions of the loop should never be satisfied, hence infinite loop) perhaps in practice limitations of the variable types prevent this? no this is not homework just a question to help understand the mechanics of variables and loops |
Hi -
Quote:
http://www.cygnus-software.com/paper...ringfloats.htm PS: On my system, I got down to "3.6452e-4951" :) |
thanks, interesting article btw
|
All times are GMT -5. The time now is 03:07 PM. |