From 53dc5a3bbadac166a8b40904790f91b351e55dd9 Mon Sep 17 00:00:00 2001 From: Roberto I Date: Sat, 9 Aug 2025 15:15:20 -0300 Subject: Functions 'frexp'-'ldexp' back to the math library They are basic for anything that handles the representation of floating numbers. --- manual/manual.of | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'manual') 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) } +@LibEntry{math.frexp (x)| + +Returns two numbers @id{m} and @id{e} such that @M{x = m2@sp{e}}, +where @id{e} is an integer. +When @id{x} is zero, NaN, +inf, or -inf, +@id{m} is equal to @id{x}; +otherwise, the absolute value of @id{m} +is in the range @C{(} @M{[0.5, 1)} @C{]}. + +} + @LibEntry{math.huge| The float value @idx{HUGE_VAL}, @@ -8348,6 +8359,12 @@ a value greater than any other numeric value. } +@LibEntry{math.ldexp(m, e)| + +Returns @M{m2@sp{e}}, where @id{e} is an integer. + +} + @LibEntry{math.log (x [, base])| Returns the logarithm of @id{x} in the given base. @@ -8403,7 +8420,7 @@ Converts the angle @id{x} from degrees to radians. When called without arguments, returns a pseudo-random float with uniform distribution -in the range @C{(} @M{[0,1)}. @C{]} +in the range @C{(} @M{[0, 1)}. @C{]} When called with two integers @id{m} and @id{n}, @id{math.random} returns a pseudo-random integer with uniform distribution in the range @M{[m, n]}. -- cgit v1.2.3-55-g6feb