formatting floating point
Jarrett Billingsley
jarrett.billingsley at gmail.com
Sat Jul 11 17:09:33 PDT 2009
On Sat, Jul 11, 2009 at 7:39 PM, Saaa<empty at needmail.com> 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 0s doesn't mean that 300 0s are
>> actually stored in the number; it just means the exponent is that
>> large.
>
> I now see what you mean by 309 digits.. No I don't want that !! :D
> string.format does only 6 digits by default, I added the extra double.max
> digits in myself from wikipedia :)
> I overestimated the precision of a double, my bad.
> (53bits != 309 digits !)
> How can I format to the full number of digits, like I did for c?
Ohh, I see. Your initial question was really vague, now that I see
what you were asking. You'd just have to convert each element of the
array separately.
More information about the Digitalmars-d-learn
mailing list