On Jun 21, 8:53*am, "Evertjan." <exjxw.hannivo... (AT) interxnl (DOT) net> wrote:
Quote:
Dr J R Stockton wrote on 20 jun 2008 in comp.lang.javascript:
I would like to add my latest version for 'any' integer d >= 0:
Fails, I think, for n=1.11, d>21 ; also for n = infinity, NaN. *
With quoted 'any', I ment any reasonable. ;-)
Catching all possibilities makes the code sound but unreadable for
instruction. |
It is only necessary to include a test that s is all-digit, such as
if (/\D/.test(d)) return n // cannot cope
IMHO, d=0 should be allowed; it should give results such as "3." which
is deprecated but not wrong.
Quote:
Sorry, John, your server seems down. |
<QUOTE>
We will be carrying out planned maintenance of our Web Hosting
platform as follows:
Saturday 21st June between 00:01 and 20:00 Hrs BST
Saturday 28th June between 00:01 and 04:00 Hrs BST
Sunday 29th June between 00:01 and 04:00 Hrs BST
</QUOTE>
--
(c) John Stockton, near London, UK. Posting with Google.
Mail: J.R.""""""""@physics.org or (better) via Home Page at
Web: <URL:http://www.merlyn.demon.co.uk/>
FAQish topics, acronyms, links, etc.; Date, Delphi, JavaScript, ...