delorie.com/archives/browse.cgi | search |
> Date: Mon, 11 Aug 2003 14:05:36 -0400 > From: DJ Delorie <dj AT delorie DOT com> > > > . The closest long double to (unsigned long long)(-1) is > > 18446744073709551613.75; > > How did you come up with this number? Deduction, perhaps mistaken: after the first iteration thru this loop: for (; integer && p >= startp; ++expcnt) { tmp = modfl(integer * 0.1L , &integer); *p-- = tochar((int)((tmp + .01L) * 10)); } the value of `integer' had a .375 as its fraction. [As I wrote in my other mail today, "(unsigned long long)(-1)" should have been "(unsigned long long)(-1) - 1".]
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |