Re: printf() on decimals

new topic     » goto parent     » topic index » view thread      » older message » newer message

aku saya wrote:
> 
> 
> Try this:
> 
> printf(1, "%.16g\n", 1999999999999990)
> printf(1, "%.16g\n", 2999999999999990)
> printf(1, "%.16g\n", 3999999999999990)
> printf(1, "%.16g\n", 4999999999999990)
> printf(1, "%.16g\n", 5999999999999990)
> printf(1, "%.16g\n", 6999999999999990)
> printf(1, "%.16g\n", 7999999999999990)
> printf(1, "%.16g\n", 8999999999999990)
> printf(1, "%.16g\n", 9999999999999990)
> 
> 
> Why is the last line printed differently?

My guess is that you reached the limit of single precision floating point.

Ray

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu