Re: isInteger, isFloat functions?
In article <BD75213E.21826 %phil.ronanzzz@ virgin.net>,
phil.ronanzzz@v irgin.net says...[color=blue]
> On 20/9/04 9:29 pm, Fred Oz wrote:
>[color=green]
> > Philip Ronan wrote:[/color]
>
> Sorry, I shouldn't have mentioned division by zero in the first place.
>[/color]
Don't be sorry, the discussion was very useful (to me, anyway).
[color=blue]
> What I meant to refer to is the Javascript (ECMA-262) entity called
> "Infinity". Any number greater than (roughly?) 10^308 equates to "Infinity"
> in Javascript.
>[/color]
Spot on.
[color=blue]
> Let's get back to the original question:
>
> If I entered this into a text box:
> "9999999---99999.9" (replace "---" with 300 "9"s)
> then it would fail this test for integers:
> alert(!/\./.test(+t) && +t==t)
>
> OK now?
>[/color]
Yes. Incidentally, the OP has not followed up ... hopefully something
here was of use?
In article <BD75213E.21826 %phil.ronanzzz@ virgin.net>,
phil.ronanzzz@v irgin.net says...[color=blue]
> On 20/9/04 9:29 pm, Fred Oz wrote:
>[color=green]
> > Philip Ronan wrote:[/color]
>
> Sorry, I shouldn't have mentioned division by zero in the first place.
>[/color]
Don't be sorry, the discussion was very useful (to me, anyway).
[color=blue]
> What I meant to refer to is the Javascript (ECMA-262) entity called
> "Infinity". Any number greater than (roughly?) 10^308 equates to "Infinity"
> in Javascript.
>[/color]
Spot on.
[color=blue]
> Let's get back to the original question:
>
> If I entered this into a text box:
> "9999999---99999.9" (replace "---" with 300 "9"s)
> then it would fail this test for integers:
> alert(!/\./.test(+t) && +t==t)
>
> OK now?
>[/color]
Yes. Incidentally, the OP has not followed up ... hopefully something
here was of use?
Comment