float x double

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

float x double

Roberto Ierusalimschy
> Has there been any discussion of changing the Lua float type from float
> to double? I did this on my own so that you could go from float type to int
> type without losing data.

We have tried to define all "floats" related to the internal representation
of numbers as "real", defined in types.h. Only the floats in lua.h were
left as "float", to avoid defining a new type in this header file. Therefore,
it should be very easy to change "number" from float to double, just changing
"real" in types.h and changing lua.h. Unfortunately, as the message said,
"we have tried", but we are not sure whether we have accomplished it. Did
anyone test this?


-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: float x double

Luiz Henrique de Figueiredo-2
>From [hidden email] Thu May 22 17:30:06 1997
>
>> Has there been any discussion of changing the Lua float type from float
>> to double? I did this on my own so that you could go from float type to int
>> type without losing data.
>
>We have tried to define all "floats" related to the internal representation
>of numbers as "real", defined in types.h. Only the floats in lua.h were
>left as "float", to avoid defining a new type in this header file. Therefore,
>it should be very easy to change "number" from float to double, just changing
>"real" in types.h and changing lua.h. Unfortunately, as the message said,
>"we have tried", but we are not sure whether we have accomplished it. Did
>anyone test this?

luac and undump depend on floats and do not work for doubles.
may be they should :-) [if you really need this, bug me!]
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: float x double

Luiz Henrique de Figueiredo-2
In reply to this post by Roberto Ierusalimschy
>From [hidden email] Fri May 23 09:28:34 1997
>
>I know what luac is.  What is undump used for?  

undump.c is the module of the lua library that loads precompiled files created
by luac. they work in concert, of course.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: float x double

John Fletcher
> Date:          Thu, 22 May 1997 17:33:21 -0300
> Reply-to:      [hidden email]
> From:          [hidden email] (Luiz Henrique de Figueiredo)
> To:            [hidden email]
> Subject:       Re: float x double

> 
> luac and undump depend on floats and do not work for doubles.
> may be they should :-) [if you really need this, bug me!]
> --lhf
> 
> 
> 
I know what luac is.  What is undump used for?  

John
---------------------------------------------------------------------
Dr John P. Fletcher          Tel: (44) 121 359 3611 ext 4625
Department of Chemical Engineering and Applied Chemistry (CEAC),
Aston University,            Fax: (44) 121 359 4094
Aston Triangle,              Email: [hidden email]
BIRMINGHAM B4 7ET  U.K.   
---------------------------------------------------------------------
CEAC Web site http://www.ceac.aston.ac.uk/
---------------------------------------------------------------------