[gtkada] how to print a value with 16 bit precision
Damien Carbonne
aetdcarbonne at free.fr
Fri Jun 13 18:36:38 CEST 2008
Vinzent Höfler a écrit :
>> As indicated by Christoph Grein in his reply, this is indeed dubious as Float has 15 digits.
>> But this is what you (your teacher?) asked.
>>
> Sure? My understanding was that BITS are different from DIGITS, unless
> base is specified as 2. ;)
>
Note: You must read : Long_Float has 15 digits.
You are right, that there are many guesses here :
Long_Float is 64 bits IEEE => 15 digits (decimal)
Float is 32 bits IEEE => 6 digits (decimal)
The fact that Long_Float has 15 digits can be deduced from what was
initially described by the OP (only 14 printed digits).
On certain machines/compilers, this may not be the case.
My understanding is that we use digits for floating point description in
Ada with decimal notation : type X is digits <#>;
If you print/describe the number using another base, then the number of
digits is different.
Anyway, I'm not a floating point expert.
If you want more information on that subject, CLA is certainly a better
place than this list to discuss it!
Regards
Damien
More information about the gtkada
mailing list