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

Re: Regex

2009-07-11 Thread Lutger
BLS wrote: > Robert Fraser wrote: >> BLS wrote: >>> Vladimir Voinkov wrote: std.regex can't be used in compile time function call. It's quite frustrating... >>> >>> see dsource.org .. afaik there is a compile time regex project. hth >> >> http://www.dsource.org/projects/scregexp >> >>

Re: Regex

2009-07-11 Thread Vladimir Voinkov
> >> see dsource.org .. afaik there is a compile time regex project. hth > > > > http://www.dsource.org/projects/scregexp > > > > But the generated functions aren't CTFE-compatible AFAIK. A CTFE regex > > engine would be um... "tricky" to say the least. About 50GB of memory > > tricky (on DMD,