diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-08-09 15:15:20 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-08-09 15:15:20 -0300 |
| commit | 53dc5a3bbadac166a8b40904790f91b351e55dd9 (patch) | |
| tree | e3bab3f52b3db44ade2a21877e874815d126919e /manual | |
| parent | 5b179eaf6a78af5f000d76147af94669d04487b2 (diff) | |
| download | lua-53dc5a3bbadac166a8b40904790f91b351e55dd9.tar.gz lua-53dc5a3bbadac166a8b40904790f91b351e55dd9.tar.bz2 lua-53dc5a3bbadac166a8b40904790f91b351e55dd9.zip | |
Functions 'frexp'-'ldexp' back to the math library
They are basic for anything that handles the representation of
floating numbers.
Diffstat (limited to 'manual')
| -rw-r--r-- | manual/manual.of | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/manual/manual.of b/manual/manual.of index 61dd42f2..89e9b8f4 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
| @@ -8341,6 +8341,17 @@ that rounds the quotient towards zero. (integer/float) | |||
| 8341 | 8341 | ||
| 8342 | } | 8342 | } |
| 8343 | 8343 | ||
| 8344 | @LibEntry{math.frexp (x)| | ||
| 8345 | |||
| 8346 | Returns two numbers @id{m} and @id{e} such that @M{x = m2@sp{e}}, | ||
| 8347 | where @id{e} is an integer. | ||
| 8348 | When @id{x} is zero, NaN, +inf, or -inf, | ||
| 8349 | @id{m} is equal to @id{x}; | ||
| 8350 | otherwise, the absolute value of @id{m} | ||
| 8351 | is in the range @C{(} @M{[0.5, 1)} @C{]}. | ||
| 8352 | |||
| 8353 | } | ||
| 8354 | |||
| 8344 | @LibEntry{math.huge| | 8355 | @LibEntry{math.huge| |
| 8345 | 8356 | ||
| 8346 | The float value @idx{HUGE_VAL}, | 8357 | The float value @idx{HUGE_VAL}, |
| @@ -8348,6 +8359,12 @@ a value greater than any other numeric value. | |||
| 8348 | 8359 | ||
| 8349 | } | 8360 | } |
| 8350 | 8361 | ||
| 8362 | @LibEntry{math.ldexp(m, e)| | ||
| 8363 | |||
| 8364 | Returns @M{m2@sp{e}}, where @id{e} is an integer. | ||
| 8365 | |||
| 8366 | } | ||
| 8367 | |||
| 8351 | @LibEntry{math.log (x [, base])| | 8368 | @LibEntry{math.log (x [, base])| |
| 8352 | 8369 | ||
| 8353 | Returns the logarithm of @id{x} in the given base. | 8370 | Returns the logarithm of @id{x} in the given base. |
| @@ -8403,7 +8420,7 @@ Converts the angle @id{x} from degrees to radians. | |||
| 8403 | 8420 | ||
| 8404 | When called without arguments, | 8421 | When called without arguments, |
| 8405 | returns a pseudo-random float with uniform distribution | 8422 | returns a pseudo-random float with uniform distribution |
| 8406 | in the range @C{(} @M{[0,1)}. @C{]} | 8423 | in the range @C{(} @M{[0, 1)}. @C{]} |
| 8407 | When called with two integers @id{m} and @id{n}, | 8424 | When called with two integers @id{m} and @id{n}, |
| 8408 | @id{math.random} returns a pseudo-random integer | 8425 | @id{math.random} returns a pseudo-random integer |
| 8409 | with uniform distribution in the range @M{[m, n]}. | 8426 | with uniform distribution in the range @M{[m, n]}. |
