diff options
author | Mike Pall <mike> | 2012-10-28 14:20:14 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2012-10-28 14:20:14 +0100 |
commit | 4e7fe815ed40d6830c11f3350a1f966b03b506c6 (patch) | |
tree | f91f69400dbb04331faef60b98762f732c3453db | |
parent | c7990063e0f1a522724a5c21845c2ea698d0f5bf (diff) | |
download | luajit-4e7fe815ed40d6830c11f3350a1f966b03b506c6.tar.gz luajit-4e7fe815ed40d6830c11f3350a1f966b03b506c6.tar.bz2 luajit-4e7fe815ed40d6830c11f3350a1f966b03b506c6.zip |
Document tonumber() enhancements.
-rw-r--r-- | doc/extensions.html | 13 |
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 | |||
170 | in <tt>"-inf"</tt>. | 170 | in <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> | ||
175 | All string-to-number conversions consistently convert integer and | ||
176 | floating-point inputs in decimal and hexadecimal on all platforms. | ||
177 | <tt>strtod()</tt> is <em>not</em> used anymore, which avoids numerous | ||
178 | problems with poor C library implementations. The builtin conversion | ||
179 | function provides full precision according to the IEEE-754 standard, it | ||
180 | works independently of the current locale and it supports hex floating-point | ||
181 | numbers (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> |
175 | An extra argument has been added to <tt>string.dump()</tt>. If set to | 186 | An 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(). | |||
198 | The PRNG generates the same sequences from the same seeds on all | 209 | The PRNG generates the same sequences from the same seeds on all |
199 | platforms and makes use of all bits in the seed argument. | 210 | platforms 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 |
201 | for every call. The result is uniformly distributed between 0 and 1. | 212 | for every call. The result is uniformly distributed between 0.0 and 1.0. |
202 | It's correctly scaled up and rounded for <tt>math.random(n [,m])</tt> to | 213 | It's correctly scaled up and rounded for <tt>math.random(n [,m])</tt> to |
203 | preserve uniformity. | 214 | preserve uniformity. |
204 | </p> | 215 | </p> |