This commit is contained in:
Roberto Ierusalimschy 2015-06-09 11:21:00 -03:00
parent 6628012e9e
commit 16e8bb360b

View File

@ -1,5 +1,5 @@
/* /*
** $Id: llimits.h,v 1.133 2015/03/04 13:31:21 roberto Exp roberto $ ** $Id: llimits.h,v 1.134 2015/03/06 19:49:50 roberto Exp roberto $
** Limits, basic types, and some other 'installation-dependent' definitions ** Limits, basic types, and some other 'installation-dependent' definitions
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -261,11 +261,11 @@ typedef unsigned long Instruction;
#endif #endif
/* /*
** module: defined as 'a - floor(a/b)*b'; the previous definition gives ** modulo: defined as 'a - floor(a/b)*b'; this definition gives NaN when
** NaN when 'b' is huge, but the result should be 'a'. 'fmod' gives the ** 'b' is huge, but the result should be 'a'. 'fmod' gives the result of
** result of 'a - trunc(a/b)*b', and therefore must be corrected when ** 'a - trunc(a/b)*b', and therefore must be corrected when 'trunc(a/b)
** 'trunc(a/b) ~= floor(a/b)'. That happens when the division has a ** ~= floor(a/b)'. That happens when the division has a non-integer
** non-integer negative result, which is equivalent to the test below ** negative result, which is equivalent to the test below.
*/ */
#if !defined(luai_nummod) #if !defined(luai_nummod)
#define luai_nummod(L,a,b,m) \ #define luai_nummod(L,a,b,m) \