Thread overview | |||||
---|---|---|---|---|---|
|
November 21, 2004 float number parse bug? | ||||
---|---|---|---|---|
| ||||
[DMD 0.106] <fparsebug.d> import std.stdio; void main() { float a = .1.234; writefln(a); // outputs 0.1 } |
November 21, 2004 Re: float number parse bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Zaitseff | Ilya Zaitseff wrote: <fparsebug.d> > import std.stdio; > > void main() > { > float a = .1.234; > writefln(a); // outputs 0.1 > } Looks like a D bug... gdc also happily outputs 0.1 This corresponding C code: <fparsebug.c> > #include <stdio.h> > > int main() > { > float a = .1.234; > printf("%f\n",a); > return 0; > } Gives an error with gcc: > fparsebug.c:5:13: too many decimal points in number Which seems like a better response ? --anders |
November 22, 2004 Re: float number parse bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Zaitseff | Added to DStress as: http://svn.kuehne.cn/dstress/nocompile/float_litaeral_dec_12.d .. http://svn.kuehne.cn/dstress/nocompile/float_litaeral_dec_17.d Thomas Ilya Zaitseff schrieb am Sun, 21 Nov 2004 22:50:16 +1000: > [DMD 0.106] > ><fparsebug.d> > import std.stdio; > > void main() > { > float a = .1.234; > writefln(a); // outputs 0.1 > } |
Copyright © 1999-2021 by the D Language Foundation