Re: At the edge of LNUM patch
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: At the edge of LNUM patch
- From: Ralph Hempel <rhempel@...>
- Date: 2008年3月27日 14:37:11 -0400
eugeny gladkih wrote:
"LHdF" == Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> writes:
>> I know that I am not alone in my toils to upgrade to new versions of Lua
>> even in an ANSI C environment when all I want to do is eliminate
>> floating point.
LHdF> For the Lua core, isn't it a simple matter of defining the correct
LHdF> luai_num* macros and LUA_NUMBER_SCAN, LUA_NUMBER_FMTin
LHdF> luaconf.h?
and we'll have problems with math library
So you modify the lua startup code to NOT open the math library, and
everything is OK except for two other things in luaconf.h
1. num_mod() must be redefined to be ((a)%(b))
2. num_pow() must be redefined to call a function that calculates
exponents of integer numbers. Mine does an iterative
multiply for b>0 and iterative divide for b<0.
Make it work, then make it fast :-) I never did go back and figure
out a way to do this non-iteratively.
You may also need to redefine LUAI_MAXNUMBER2STR and str2number()
Ralph
- References:
- Re: At the edge of LNUM patch, Doug Currie
- Re: At the edge of LNUM patch, Asko Kauppi
- Re: At the edge of LNUM patch, Miles Bader
- Re: At the edge of LNUM patch, Mike Pall
- Re: At the edge of LNUM patch, Bogdan Marinescu
- Re: At the edge of LNUM patch, Asko Kauppi
- Re: At the edge of LNUM patch, David Kastrup
- Re: At the edge of LNUM patch, askok
- Re: At the edge of LNUM patch, Mike Pall
- Re: At the edge of LNUM patch, Doug Rogers
- Re: At the edge of LNUM patch, Luiz Henrique de Figueiredo
- Re: At the edge of LNUM patch, eugeny gladkih