D - floating point bug
- imr1984 (13/13) Feb 11 2004 the following code does not run as expected, it should print out "-1" tw...
- davepermen (7/20) Feb 11 2004 doesn't toString only take an uint (and thus casts it?)
- Sean Kelly (4/8) Feb 11 2004 AFAIK there are no floating point conversions in Phobos yet, unless you
the following code does not run as expected, it should print out "-1" twice, but it prints out -1 followed by 0. Its probably a bug with toString import std.c.stdio; import std.string; void test(float f) { printf("%f\n", f); printf("%s\n", toStringz(toString(f))); } void main() { test(-1); }
Feb 11 2004
doesn't toString only take an uint (and thus casts it?) could be manfred hit a much bigger issue. namely floating point conversions in general. dunno.. it's late again:D "imr1984" <imr1984_member pathlink.com> schrieb im Newsbeitrag news:c0e19a$j8u$1 digitaldaemon.com...the following code does not run as expected, it should print out "-1"twice, butit prints out -1 followed by 0. Its probably a bug with toString import std.c.stdio; import std.string; void test(float f) { printf("%f\n", f); printf("%s\n", toStringz(toString(f))); } void main() { test(-1); }
Feb 11 2004
davepermen wrote:doesn't toString only take an uint (and thus casts it?) could be manfred hit a much bigger issue. namely floating point conversions in general.AFAIK there are no floating point conversions in Phobos yet, unless you count streams. I assume they're on the to-do list. Sean
Feb 11 2004