From 4e7fe815ed40d6830c11f3350a1f966b03b506c6 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Sun, 28 Oct 2012 14:20:14 +0100 Subject: [PATCH] Document tonumber() enhancements. --- doc/extensions.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/extensions.html b/doc/extensions.html index 0679921a..d32dd37c 100644 --- a/doc/extensions.html +++ b/doc/extensions.html @@ -170,6 +170,17 @@ positive infinity results in "inf" and negative infinity results in "-inf".

+

tonumber() etc. use builtin string to number conversion

+

+All string-to-number conversions consistently convert integer and +floating-point inputs in decimal and hexadecimal on all platforms. +strtod() is not used anymore, which avoids numerous +problems with poor C library implementations. The builtin conversion +function provides full precision according to the IEEE-754 standard, it +works independently of the current locale and it supports hex floating-point +numbers (e.g. 0x1.5p-3). +

+

string.dump(f [,strip]) generates portable bytecode

An extra argument has been added to string.dump(). If set to @@ -198,7 +209,7 @@ implementation which uses the platform-specific ANSI rand(). The PRNG generates the same sequences from the same seeds on all platforms and makes use of all bits in the seed argument. math.random() without arguments generates 52 pseudo-random bits -for every call. The result is uniformly distributed between 0 and 1. +for every call. The result is uniformly distributed between 0.0 and 1.0. It's correctly scaled up and rounded for math.random(n [,m]) to preserve uniformity.