Re: Two questions about "%a"

2011-03-04 Thread Magnus Lie Hetland
On 2011-03-04 03:16:50 +0100, Nick Sabalausky said: I'm no floating-point expert, but I would think that the only way to get an exact representation would be to output the raw data in hex (or binary, or octal, etc): writef("0x%X", cast(ulong)1.2); That's also an option, certainly. Then I co

Re: Two questions about "%a"

2011-03-03 Thread Nick Sabalausky
"Lars T. Kyllingstad" wrote in message news:iknfsh$13ga$1...@digitalmars.com... > On Wed, 02 Mar 2011 13:35:11 +0100, Magnus Lie Hetland wrote: > >> First question: I just noticed that writefln("%a", 1.2) writes >> 0x1.3p+0, while writeln(format("%a", 1.2)) (that is, with >> std.strin

Re: Two questions about "%a"

2011-03-02 Thread Lars T. Kyllingstad
On Wed, 02 Mar 2011 13:35:11 +0100, Magnus Lie Hetland wrote: > First question: I just noticed that writefln("%a", 1.2) writes > 0x1.3p+0, while writeln(format("%a", 1.2)) (that is, with > std.string.format) writes 0x9.8p-3 ... wouldn't it be nice > to be consistent here? (

Two questions about "%a"

2011-03-02 Thread Magnus Lie Hetland
First question: I just noticed that writefln("%a", 1.2) writes 0x1.3p+0, while writeln(format("%a", 1.2)) (that is, with std.string.format) writes 0x9.8p-3 ... wouldn't it be nice to be consistent here? (The former is what printf in gcc gives.) Or am I missing a differen