aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2012-10-28 14:20:14 +0100
committerMike Pall <mike>2012-10-28 14:20:14 +0100
commit4e7fe815ed40d6830c11f3350a1f966b03b506c6 (patch)
treef91f69400dbb04331faef60b98762f732c3453db
parentc7990063e0f1a522724a5c21845c2ea698d0f5bf (diff)
downloadluajit-4e7fe815ed40d6830c11f3350a1f966b03b506c6.tar.gz
luajit-4e7fe815ed40d6830c11f3350a1f966b03b506c6.tar.bz2
luajit-4e7fe815ed40d6830c11f3350a1f966b03b506c6.zip
Document tonumber() enhancements.
-rw-r--r--doc/extensions.html13
1 files changed, 12 insertions, 1 deletions
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 <tt>"inf"</tt> and negative infinity results
170in <tt>"-inf"</tt>. 170in <tt>"-inf"</tt>.
171</p> 171</p>
172 172
173<h3 id="tonumber"><tt>tonumber()</tt> etc. use builtin string to number conversion</h3>
174<p>
175All string-to-number conversions consistently convert integer and
176floating-point inputs in decimal and hexadecimal on all platforms.
177<tt>strtod()</tt> is <em>not</em> used anymore, which avoids numerous
178problems with poor C library implementations. The builtin conversion
179function provides full precision according to the IEEE-754 standard, it
180works independently of the current locale and it supports hex floating-point
181numbers (e.g. <tt>0x1.5p-3</tt>).
182</p>
183
173<h3 id="string_dump"><tt>string.dump(f [,strip])</tt> generates portable bytecode</h3> 184<h3 id="string_dump"><tt>string.dump(f [,strip])</tt> generates portable bytecode</h3>
174<p> 185<p>
175An extra argument has been added to <tt>string.dump()</tt>. If set to 186An extra argument has been added to <tt>string.dump()</tt>. If set to
@@ -198,7 +209,7 @@ implementation which uses the platform-specific ANSI rand().
198The PRNG generates the same sequences from the same seeds on all 209The PRNG generates the same sequences from the same seeds on all
199platforms and makes use of all bits in the seed argument. 210platforms and makes use of all bits in the seed argument.
200<tt>math.random()</tt> without arguments generates 52 pseudo-random bits 211<tt>math.random()</tt> without arguments generates 52 pseudo-random bits
201for every call. The result is uniformly distributed between 0 and 1. 212for every call. The result is uniformly distributed between 0.0 and 1.0.
202It's correctly scaled up and rounded for <tt>math.random(n&nbsp;[,m])</tt> to 213It's correctly scaled up and rounded for <tt>math.random(n&nbsp;[,m])</tt> to
203preserve uniformity. 214preserve uniformity.
204</p> 215</p>