Re: formatting floating point

2009-07-13 Thread Saaa
>>> You'd just have to convert each element of the >>> array separately. >> >> I found the formatting options, they are in std.format.. >> (I was apparently searching for the 'g' option.. ) >> >> this seems to work (using std2.string.format) >> >> double[] d1; >> d1=[double.max,double.min]; >> char

Re: formatting floating point

2009-07-13 Thread Don
Saaa wrote: Ohh, I see. Your initial question was really vague, now that I see what you were asking. sorry You'd just have to convert each element of the array separately. I found the formatting options, they are in std.format.. (I was apparently searching for the 'g' option.. ) this seems

Re: formatting floating point

2009-07-11 Thread Saaa
>Ohh, I see. Your initial question was really vague, now that I see >what you were asking. sorry >You'd just have to convert each element of the >array separately. I found the formatting options, they are in std.format.. (I was apparently searching for the 'g' option.. ) this seems to work (usin

Re: formatting floating point

2009-07-11 Thread Jarrett Billingsley
On Sat, Jul 11, 2009 at 7:39 PM, Saaa wrote: >> >> Um, doubles don't have infinite precision.  See those digits that it >> output?  That's all you get.  Those are the only digits that are >> necessary because those are the only digits that are *stored*.  Just >> because it's followed by almost 300

Re: formatting floating point

2009-07-11 Thread Saaa
"Jarrett Billingsley" wrote in message news:mailman.51.1247352795.14071.digitalmars-d-le...@puremagic.com... > On Sat, Jul 11, 2009 at 6:44 PM, Saaa wrote: >>> double d[2] = [ 0, 1, double.max]; >>> char[] c = format(d); >>> >>> How do I get c to represent full precision? >>> >>> "[0,1,1.7976931

Re: formatting floating point

2009-07-11 Thread Jarrett Billingsley
On Sat, Jul 11, 2009 at 6:44 PM, Saaa wrote: >> double d[2] = [ 0, 1, double.max]; >> char[] c = format(d); >> >> How do I get c to represent full precision? >> >> "[0,1,1.7976931348623157e+308]" // but then with double.max being >> represented fully > >> You want a 309-digit number consisting most

Re: formatting floating point

2009-07-11 Thread Saaa
> double d[2] = [ 0, 1, double.max]; > char[] c = format(d); > > How do I get c to represent full precision? > > "[0,1,1.7976931348623157e+308]" // but then with double.max being > represented fully > You want a 309-digit number consisting mostly of 0s? Yes, but only if they are necessary. 0 does

Re: formatting floating point

2009-07-11 Thread Jarrett Billingsley
On Sat, Jul 11, 2009 at 5:50 PM, Saaa wrote: > double d[2] = [ 0, 1, double.max]; > char[] c = format(d); > >  How do I get c to represent full precision? > > "[0,1,1.7976931348623157e+308]" // but then with double.max being > represented fully You want a 309-digit number consisting mostly of 0s?

formatting floating point

2009-07-11 Thread Saaa
double d[2] = [ 0, 1, double.max]; char[] c = format(d); How do I get c to represent full precision? "[0,1,1.7976931348623157e+308]" // but then with double.max being represented fully