[scilab-Users] double floating point numbers in Scilab

Stéphane Mottelet stephane.mottelet at utc.fr
Thu Apr 3 18:43:19 CEST 2008


Stéphane Mottelet a écrit :
> Hi all.
>
> Is there a Scilab function which returns the hexadecimal
> string corresponding to a given 64 bits float ?
>
> This can be easily done in C by using the
> %x conversion char, i.e.
>
> printf("%x\n",(double)1.0/3.0);
>
> produces :
>
> 3fd55555
>
> Why does the Scilab printf make an integer
> conversion,
>
> -->printf("%x\n",1.0/3.0);       0
>
> althoug this is not really needed since the dec2hex() macro
> already works for that ?
>
> S.
>
>
>
>
Sorry, it should be read above

printf("%x%x\n",(double)1.0/3.0);

produces :

3fd5555555555555

S.

-- 
Stéphane Mottelet
Laboratoire de Mathématiques Appliquées
Université de Technologie de Compiègne
http://www.lmac.utc.fr/~mottelet




More information about the users mailing list