f



JavaScript Regex

Dear JavaScripters:

     I have not found quite the detail that I need for regexes.  If
you have a URL to a good site, please post it.  In particular, how do
I group subexpressions?

     I wish to parse a string to see if it is a valid fixed-decimal
value.

     I start with
          /^

     How do I check a set of characters optionally?  I want to check
for a sign character.  The string might start with "+" or "-", but if
it starts with neither, that is fine.  Do I leave an empty choice in a
parens set?  Is it then
          ([+-]|)
or
          [+-]?
?

     Then come optional digits:
          \d*

     Then another complex maybe for the decimal point and digits
following:
          (\.\d*|)
or
          (\.\d*)?
?

     And the end
          $/

     The regex should accept:
          123
          +123
          -123
          123.
          +123.
          -123.
          123.45
          +123.45
          -123.45

     It will also accept
          .
          +.
          -.
That is acceptable.  I will check for digits with another regex.

Sincerely,

Gene Wirchenko
0
genew (1214)
1/12/2012 4:51:26 AM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

19 Replies
3915 Views

Similar Articles

[PageSpeed] 42

On Wed, 11 Jan 2012 20:51:26 -0800, Gene Wirchenko wrote:

>     I have not found quite the detail that I need for regexes.  If
>you have a URL to a good site, please post it.  

http://www.regular-expressions.info/

But note:
http://www.regular-expressions.info/javascript.html

Also useful:
https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp

>In particular, how do
>I group subexpressions?
>
>     I wish to parse a string to see if it is a valid fixed-decimal
>value.
>
>     I start with
>          /^
>
>     How do I check a set of characters optionally?  I want to check
>for a sign character.  The string might start with "+" or "-", but if
>it starts with neither, that is fine.  Do I leave an empty choice in a
>parens set?  Is it then
>          ([+-]|)
>or
>          [+-]?
>?

The latter.

>     Then come optional digits:
>          \d*
>
>     Then another complex maybe for the decimal point and digits
>following:
>          (\.\d*|)
>or
>          (\.\d*)?
>?

Again, the latter.

>[...]
>     The regex should accept:
>          123
>          +123
>          -123
>          123.
>          +123.
>          -123.
>          123.45
>          +123.45
>          -123.45
>
>     It will also accept
>          .
>          +.
>          -.
>That is acceptable.  I will check for digits with another regex.

See here for a good tutorial on this problem:
http://www.regular-expressions.info/floatingpoint.html
-- 
Ross McKay, Toronto, NSW Australia
"Some people, when confronted with a problem, think "I know,
 I'll use regular expressions." Now they have two problems.
 - Jamie Zawinski
0
1/12/2012 6:07:45 AM
On Wed, 11 Jan 2012 20:51:26 -0800, Gene Wirchenko wrote:

>      I wish to parse a string to see if it is a valid fixed-decimal
> value.

/^[+-]?\d{1,}(\.\d*)?$/

http://www.sined.co.uk/tmp/regex.htm

Rgds

Denis McMahon
0
1/12/2012 3:05:27 PM
Denis McMahon wrote:

> On Wed, 11 Jan 2012 20:51:26 -0800, Gene Wirchenko wrote:
>>      I wish to parse a string to see if it is a valid fixed-decimal
>> value.
> 
> /^[+-]?\d{1,}(\.\d*)?$/
> 
> http://www.sined.co.uk/tmp/regex.htm

Wrong, see the ECMAScript Language Specification and, e. g., the JSON 
website.  And what is *fixed* about this?

  !isNaN(+s)

where `s' is a String value, suffices for strings representing floating-
point values.  If "fixed" is supposed to mean "a fixed number of decimals", 
a more elaborate expression needs to be used, but not this one (what about 
leading "." and scientific notation?).  We have been over this.


PointedEars
-- 
var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16
0
PointedEars (2489)
1/12/2012 3:42:38 PM
Denis McMahon wrote on 12 jan 2012 in comp.lang.javascript:

> On Wed, 11 Jan 2012 20:51:26 -0800, Gene Wirchenko wrote:
> 
>>      I wish to parse a string to see if it is a valid fixed-decimal
>> value.
> 
> /^[+-]?\d{1,}(\.\d*)?$/

var result = !isNaN(t) && !/[e\s]/i.test(t)

[allows  .123 ]


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
0
1/12/2012 3:56:54 PM
Thomas 'PointedEars' Lahn wrote on 12 jan 2012 in comp.lang.javascript:

> Denis McMahon wrote:
> 
>> On Wed, 11 Jan 2012 20:51:26 -0800, Gene Wirchenko wrote:
>>>      I wish to parse a string to see if it is a valid fixed-decimal
>>> value.
>> 
>> /^[+-]?\d{1,}(\.\d*)?$/
>> 
>> http://www.sined.co.uk/tmp/regex.htm
> 
> Wrong, see the ECMAScript Language Specification and, e. g., the JSON 
> website.  And what is *fixed* about this?
> 
>   !isNaN(+s)

Will also accept "2.2e7" which is not a fixed-decimal but floating.

There is no need for the +, as isNaN() will accept a string,
and do the conversion internally.

> where `s' is a String value, suffices for strings representing
> floating- point values.  If "fixed" is supposed to mean "a fixed
> number of decimals", a more elaborate expression needs to be used, but
> not this one (what about leading "." and scientific notation?).  We
> have been over this. 



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
0
1/12/2012 4:09:12 PM
On Thu, 12 Jan 2012 17:07:45 +1100, Ross McKay
<au.org.zeta.at.rosko@invalid.invalid> wrote:

>On Wed, 11 Jan 2012 20:51:26 -0800, Gene Wirchenko wrote:
>
>>     I have not found quite the detail that I need for regexes.  If
>>you have a URL to a good site, please post it.  
>
>http://www.regular-expressions.info/
>
>But note:
>http://www.regular-expressions.info/javascript.html
>
>Also useful:
>https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions
>https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp

[snip]

>See here for a good tutorial on this problem:
>http://www.regular-expressions.info/floatingpoint.html

     Thank you for the links and for the confirmation of my regex.

     Actually, I am not concerned about floating-point.  My app will
only use integers and fixed-point numbers.

Sincerely,

Gene Wirchenko
0
genew (1214)
1/12/2012 8:13:47 PM
Gene Wirchenko wrote on 12 jan 2012 in comp.lang.javascript:

> Actually, I am not concerned about floating-point.  My app will
> only use integers and fixed-point numbers.

If so, and if you don't need to disallow whitespace,

var boolResult = !isNaN(str);

will do.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
0
1/12/2012 8:48:13 PM
In comp.lang.javascript message <Xns9FD8DDCD38A6Beejj99@194.109.133.133>
, Thu, 12 Jan 2012 20:48:13, Evertjan. <exjxw.hannivoort@interxnl.net>
posted:

>Gene Wirchenko wrote on 12 jan 2012 in comp.lang.javascript:
>
>> Actually, I am not concerned about floating-point.  My app will
>> only use integers and fixed-point numbers.
>
>If so, and if you don't need to disallow whitespace,
>
>var boolResult = !isNaN(str);

Accepts   str = "0x0"   which is probably not wanted.

-- 
 (c) John Stockton, nr London UK.  ?@merlyn.demon.co.uk  DOS 3.3 6.20 ; WinXP.
   Web  <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
   PAS EXE TXT ZIP via  <http://www.merlyn.demon.co.uk/programs/00index.htm>
   My DOS  <http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
0
reply1202 (5)
1/14/2012 8:41:07 PM
In comp.lang.javascript message <Xns9FD8AC68C9038eejj99@194.109.133.133>
, Thu, 12 Jan 2012 15:56:54, Evertjan. <exjxw.hannivoort@interxnl.net>
posted:

>Denis McMahon wrote on 12 jan 2012 in comp.lang.javascript:
>
>> On Wed, 11 Jan 2012 20:51:26 -0800, Gene Wirchenko wrote:
>>
>>>      I wish to parse a string to see if it is a valid fixed-decimal
>>> value.
>>
>> /^[+-]?\d{1,}(\.\d*)?$/
>
>var result = !isNaN(t) && !/[e\s]/i.test(t)
>
>[allows  .123 ]

Such should NOT be allowed, if there is any option (IUPAP/SUNAMCO) - an
inadequately-guarded dot can too easily fail to be noticed.

-- 
 (c) John Stockton, nr London UK.  ?@merlyn.demon.co.uk  Turnpike v6.05  MIME.
   <http://www.merlyn.demon.co.uk/>  TP/BP/Delphi/&c., FAQqy topics & links;
   <http://www.merlyn.demon.co.uk/clpb-faq.txt>    RAH Prins : c.l.p.b mFAQ;
   <ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip>  Timo Salmi's Turbo Pascal FAQ.
0
reply1202 (5)
1/14/2012 8:44:50 PM
In comp.lang.javascript message <8kosg7tha6n6epo47krtaulm9a269kvclo@4ax.
com>, Wed, 11 Jan 2012 20:51:26, Gene Wirchenko <genew@ocis.net> posted:

>
>     I have not found quite the detail that I need for regexes.  If
>you have a URL to a good site, please post it.

<http://www.merlyn.demon.co.uk/js-valid.htm> lists some that I have
found.


>     I wish to parse a string to see if it is a valid fixed-decimal
>value.

Cannot actually be done.  "2012" may in truth be 2^8+1, to base 5.

And 014747 is really a bit pattern representation of a computer
instruction, highly amusing to those who can read PDP-11 code; it does
not mean decimal 6631.

For human input, you should generally allow leading and trailing
whitespace.  Then an optional sign.  Then at least one digit.  Then,
optionally, (a decimal point followed by at least one digit).  In any
particular application, you can probably also limit the number of
digits; for example, in currency, except for Government work, any more
than say nine digits before the decimal point probably means that the
cat has walked along the keyboard, or the euro has crashed, etc.


<http://www.merlyn.demon.co.uk/js-valid.htm#VNP> has what you need, if
you remove the exponent part.

-- 
 (c) John Stockton, nr London, UK.    ?@merlyn.demon.co.uk     Turnpike v6.05.
 Website  <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
 Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
0
reply1202 (5)
1/14/2012 9:23:20 PM
Dr J R Stockton wrote on 14 jan 2012 in comp.lang.javascript:

> n comp.lang.javascript message <Xns9FD8DDCD38A6Beejj99@194.109.133.133>
> , Thu, 12 Jan 2012 20:48:13, Evertjan. <exjxw.hannivoort@interxnl.net>
> posted:
> 
>>Gene Wirchenko wrote on 12 jan 2012 in comp.lang.javascript:
>>
>>> Actually, I am not concerned about floating-point.  My app will
>>> only use integers and fixed-point numbers.
>>
>>If so, and if you don't need to disallow whitespace,
>>
>>var boolResult = !isNaN(str);
> 
> Accepts   str = "0x0"   which is probably not wanted.

Probably not, the OP stipulated that floating point etc. need not be 
concidered, that's why I simplified my original.

Try for completeness:

var boolResult = !isNaN(t) && /[^\d\.]/i.test(t)


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
0
1/15/2012 8:08:20 PM
On Sat, 14 Jan 2012 21:23:20 +0000, Dr J R Stockton
<reply1202@merlyn.demon.co.uk> wrote:

>In comp.lang.javascript message <8kosg7tha6n6epo47krtaulm9a269kvclo@4ax.
>com>, Wed, 11 Jan 2012 20:51:26, Gene Wirchenko <genew@ocis.net> posted:
>
>>
>>     I have not found quite the detail that I need for regexes.  If
>>you have a URL to a good site, please post it.
>
><http://www.merlyn.demon.co.uk/js-valid.htm> lists some that I have
>found.
>
>
>>     I wish to parse a string to see if it is a valid fixed-decimal
>>value.
>
>Cannot actually be done.  "2012" may in truth be 2^8+1, to base 5.

     How fatuous and condescending!  I am checking whether a string is
valid fixed-decimal value.  Whether it can also be interpreted as
something else is irrelevant.

     The rest of your post is similar.  I *have* considered what I
require.  What I asked about is but a small part of it.  (I do believe
in doing my own work as much as I can.)

[snip]

Sincerely,

Gene Wirchenko
0
genew (1214)
1/16/2012 5:10:03 AM
In comp.lang.javascript message <Xns9FDBD7097E631eejj99@194.109.133.133>
, Sun, 15 Jan 2012 20:08:20, Evertjan. <exjxw.hannivoort@interxnl.net>
posted:

>Dr J R Stockton wrote on 14 jan 2012 in comp.lang.javascript:
>
>> n comp.lang.javascript message <Xns9FD8DDCD38A6Beejj99@194.109.133.133>
>> , Thu, 12 Jan 2012 20:48:13, Evertjan. <exjxw.hannivoort@interxnl.net>
>> posted:
>>
>>>Gene Wirchenko wrote on 12 jan 2012 in comp.lang.javascript:
>>>
>>>> Actually, I am not concerned about floating-point.  My app will
>>>> only use integers and fixed-point numbers.
>>>
>>>If so, and if you don't need to disallow whitespace,
>>>
>>>var boolResult = !isNaN(str);
>>
>> Accepts   str = "0x0"   which is probably not wanted.
>
>Probably not, the OP stipulated that floating point etc. need not be
>concidered, that's why I simplified my original.
>
>Try for completeness:
>
>var boolResult = !isNaN(t) && /[^\d\.]/i.test(t)

Works better with another ! !!

That will accept the deprecated forms '1.' and '.1'.

That will accept numbers so long that they read as Infinity.

                        I wonder whether Gene knows how to tell
                        whether a Number is positive or negative?

-- 
 (c) John Stockton, nr London UK  ?@merlyn.demon.co.uk  IE8 FF8 Op11 Sf5 Cr15
   news:comp.lang.javascript FAQ <http://www.jibbering.com/faq/index.html>.
   <http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
   <http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
0
reply1203 (8)
1/16/2012 9:55:11 PM
In comp.lang.javascript message <c4c7h7t2qghi49i0esm44sl00ki2cq27q9@4ax.
com>, Sun, 15 Jan 2012 21:10:03, Gene Wirchenko <genew@ocis.net> posted:

>On Sat, 14 Jan 2012 21:23:20 +0000, Dr J R Stockton
><reply1202@merlyn.demon.co.uk> wrote:
>
>>In comp.lang.javascript message <8kosg7tha6n6epo47krtaulm9a269kvclo@4ax.
>>com>, Wed, 11 Jan 2012 20:51:26, Gene Wirchenko <genew@ocis.net> posted:
>>
>>>
>>>     I have not found quite the detail that I need for regexes.  If
>>>you have a URL to a good site, please post it.
>>
>><http://www.merlyn.demon.co.uk/js-valid.htm> lists some that I have
>>found.
>>
>>
>>>     I wish to parse a string to see if it is a valid fixed-decimal
>>>value.
>>
>>Cannot actually be done.  "2012" may in truth be 2^8+1, to base 5.
>
>     How fatuous and condescending!  I am checking whether a string is
>valid fixed-decimal value.

No, you are checking whether it can be interpreted as a valid integer or
fixed-point decimal value.  One cannot tell what a string IS by mere
inspection of the string.

>  Whether it can also be interpreted as
>something else is irrelevant.
>
>     The rest of your post is similar.  I *have* considered what I
>require.  What I asked about is but a small part of it.  (I do believe
>in doing my own work as much as I can.)

Doing your own work where reasonable is good.  But regurgitating all the
old and well-known follies here is not good.  We on the whole, or I at
least, would prefer you to take advantage of what is already well-known
and sufficiently published in the field, and then to present new and
therefore interesting problems, so encouraging the advancement of
learning in general.

Remember what Newton said about the shoulders of giants.  And note that
he probably did not invent that saying, but more likely got it
indirectly from Bernard of Chartres.

-- 
 (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk  Turnpike v6.05  MIME.
  Web  <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links;
  Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
 No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
0
reply1203 (8)
1/17/2012 8:01:36 PM
Dr J R Stockton wrote:
> Gene Wirchenko posted:
>> Dr J R Stockton wrote:
>>> Gene Wirchenko posted:
>>>> I wish to parse a string to see if it is a valid fixed-decimal
>>>> value.
>>>
>>> Cannot actually be done. =A0"2012" may in truth be 2^8+1, to base 5.
>>
>> How fatuous and condescending! =A0I am checking whether a string is
>> valid fixed-decimal value.
>
> No, you are checking whether it can be interpreted as a valid integer or
> fixed-point decimal value. =A0One cannot tell what a string IS by mere
> inspection of the string.

Did you really misunderstand?  Or are you being pedantic for no good
reason?

I think it was clear to all other participants approximately what Gene
was asking about, and several helpful responses have already been
given.  Maybe there would have been slightly less ambiguity had he
said, "I wish to programatically determine if a given string matches a
standard format used to represent fixed-point values," or some such,
but I for one had no problem translating "I wish to parse a string to
see if it is a valid fixed-decimal value" to mean much the same.

Now, on the other hand, Gene, the first result in

    http://www.google.com/search?q=3Djavascript+regex+floating+point

is to a Stack Overflow page which has this answer:

    /^[-+]?[0-9]*\.?[0-9]+$/

That might or might not meet your requirements (it allows leading
zeroes and bare decimals), but it could at least be a good starting
point.  And it wasn't hard to find.

  -- Scott
0
scott.sauyet (381)
1/18/2012 1:42:13 PM
In comp.lang.javascript message <Xns9FD8AC68C9038eejj99@194.109.133.133>
, Thu, 12 Jan 2012 15:56:54, Evertjan. <exjxw.hannivoort@interxnl.net>
posted:

>Denis McMahon wrote on 12 jan 2012 in comp.lang.javascript:
>
>> On Wed, 11 Jan 2012 20:51:26 -0800, Gene Wirchenko wrote:
>>
>>>      I wish to parse a string to see if it is a valid fixed-decimal
>>> value.
>>
>> /^[+-]?\d{1,}(\.\d*)?$/
>
>var result = !isNaN(t) && !/[e\s]/i.test(t)
>
>[allows  .123 ]

It also allows "Infinity" with optional sign.

Set t = "NaN", and one can see that "NaN" is wrong; it should be spelt
"Nan", because ECMAscript NaN is undoubtedly a Number but not a number.

-- 
 (c) John Stockton, nr London, UK.    ?@merlyn.demon.co.uk     Turnpike v6.05.
 Website  <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
 Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
0
reply1203 (8)
1/19/2012 7:59:21 PM
In comp.lang.javascript message <fcf854ac-2bf2-45c9-b458-28f5b07b2c12@i6
g2000vbk.googlegroups.com>, Wed, 18 Jan 2012 05:42:13, Scott Sauyet
<scott.sauyet@gmail.com> posted:

>Dr J R Stockton wrote:
>> Gene Wirchenko posted:
>>> Dr J R Stockton wrote:
>>>> Gene Wirchenko posted:
>>>>> I wish to parse a string to see if it is a valid fixed-decimal
>>>>> value.
>>>>
>>>> Cannot actually be done. �"2012" may in truth be 2^8+1, to base 5.
>>>
>>> How fatuous and condescending! �I am checking whether a string is
>>> valid fixed-decimal value.
>>
>> No, you are checking whether it can be interpreted as a valid integer or
>> fixed-point decimal value. �One cannot tell what a string IS by mere
>> inspection of the string.
>
>Did you really misunderstand?  Or are you being pedantic for no good
>reason?

I know more or less what he meant, but it was expressed in a woolly-
minded manner.  Those are not exact descriptions of what he wants to
test for.

Before designing such a test, it is necessary to know what characters,
if any, can be present before or after the number; whether a sign is
permissible or compulsory or neither, whether a fixed-point number is
required to have a point in it, whether there must be a digit on each
side of the point or it is allowable to have a digit on only one side,
whether starting with <zero><digit> is allowed, whether there should be
any bound on the magnitude, whether there may be thousands separators
(or ones for lakhs & crores, to support the Indian market), etc.

AFAIK, the Canadian Government of Canada (or of Quebec) may impose a
requirement to accept also comma as the decimal separator.

Those who express their needs fully, clearly, and unambiguously may well
realise the solution while doing so, and otherwise are likely to get
useful, accurate answers.


>Now, on the other hand, Gene, the first result in
>
>    http://www.google.com/search?q=javascript+regex+floating+point
>
>is to a Stack Overflow page which has this answer:
>
>    /^[-+]?[0-9]*\.?[0-9]+$/
>
>That might or might not meet your requirements (it allows leading
>zeroes and bare decimals), but it could at least be a good starting
>point.  And it wasn't hard to find.

The answers on my page would have been easy to find, at least after I
gave the URL.  And I know about \d.

-- 
 (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk  Turnpike v6.05  MIME.
  Web  <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links;
  Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
 No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
0
reply1203 (8)
1/19/2012 8:11:42 PM
Dr J R Stockton wrote on 19 jan 2012 in comp.lang.javascript:

>>var result = !isNaN(t) && !/[e\s]/i.test(t)
>>
>>[allows  .123 ]
> 
> It also allows "Infinity" with optional sign.

This better?

Remember we are talking aboutr strings:
t = '-Infinity'
not
t = -Infinity

<script type='text/javascript'>

var t = '-Infinity';
//var t = 'NaN';
//var t = '.259';

var result = !isNaN(t) && !/[a-z\s]/i.test(t);

alert(t+' is a fixed point number?\n'+result);

</script>
 
> Set t = "NaN", and one can see that "NaN" is wrong; it should be spelt
> "Nan", because ECMAscript NaN is undoubtedly a Number but not a number.

A fixed point Number?

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
0
1/20/2012 9:19:57 AM
In comp.lang.javascript message <Xns9FE0691ABB4B5eejj99@194.109.133.133>
, Fri, 20 Jan 2012 09:19:57, Evertjan. <exjxw.hannivoort@interxnl.net>
posted:
>Dr J R Stockton wrote on 19 jan 2012 in comp.lang.javascript:

>> Set t = "NaN", and one can see that "NaN" is wrong; it should be spelt
>> "Nan", because ECMAscript NaN is undoubtedly a Number but not a number.
>
>A fixed point Number?

That had no especial reference to GW's number-strings.  Variables of
type Number are invariably [supposed to be] IEEE 754 double-precision
binary floating-point format internally, as [the representations that I
have seen of] their internal formats are all in terms of sign, exponent,
and mantissa.

Although   typeof NaN    is "number", ECMA is clear that the type is
really 'Number' - but the value of NaN does not lie in the inclusive
range from -Infinity to +Infinity.

-- 
 (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk  Turnpike 6.05  WinXP.
 Web  <http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and links.
 Command-prompt MiniTrue is useful for viewing/searching/altering files. Free,
 DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.
0
reply1203 (8)
1/21/2012 8:27:30 PM
Reply: