| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Conversion float->string ensures that, for any float f,
tonumber(tostring(f)) == f, but still avoiding noise like 1.1
converting to "1.1000000000000001".
|
|
|
|
|
| |
Test files are more polite regarding the use of globals when locals
would do, and when globals are necessary deleting them after use.
|
|
|
|
| |
Added a print with the random seeds used in the tests of 'random'.
|
|
|
|
|
| |
Several details in code (e.g., moving a variable to the most inner
scope that encloses its uses), comments, parameter names, extra tests.
|
| |
|
|
|
|
|
|
|
|
| |
The macro 'luaL_pushfail' documents all places in the standard libraries
that return nil to signal some kind of failure. It is defined as
'lua_pushnil'. The manual also got a notation (@fail) to document those
returns. The tests were changed to be agnostic regarding whether 'fail'
is 'nil' or 'false'.
|
|
|
|
|
|
|
| |
Attributes changed to posfixed ('x <const>', instead of '<const> x'),
and "toclose" renamed to "close". Posfixed attributes seem to make it
clearer that it applies to only one variable when there are multiple
variables.
|
| |
|
|
|
|
|
| |
A call to 'math.randomseed()' returns the two components of the seed
it set, so that they can be used to set that same seed again.
|
|
|
|
|
| |
Local constant variables initialized with compile-time constants
are optimized away from the code.
|
|
|
|
|
| |
A variable can be declared const, which means it cannot be assigned to,
with the syntax 'local <const> name = exp'.
|
|
|
|
|
|
| |
When called with no arguments, 'math.randomseed' uses time and ASLR
to generate a somewhat random seed. the initial seed when Lua starts
is generated this way.
|
|
|
|
|
|
|
| |
The call 'math.rand()' converts the higher bits of the internal unsigned
integer random to a float, instead of its lower bits. That ensures that
Lua compiled with different float precisions always generates equal (up
to the available precision) random numbers when given the same seed.
|
|
|
|
|
| |
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all test files; only the file name are kept.
|
|
|
|
|
|
|
|
|
| |
The multiplication (m*b) used to test whether 'm' is non-zero and
'm' and 'b' have different signs can underflow for very small numbers,
giving a wrong result. The use of explicit comparisons solves this
problem. This commit also adds several new tests for '%' (both for
floats and for integers) to exercise more corner cases, such as
very large and very small values.
|
|
|
|
|
|
|
| |
From the point of view of 'git', all names are relative to the root
directory of the project. So, file names in '$Id:' also should be
relative to that directory: the proper name for test file 'all.lua'
is 'testes/all.lua'.
|
|
|
|
|
| |
Opocode was using 'luai_numdiv' (float division) instead of
'luai_numidiv' (integer division).
|
|
|