Re: EX3: $a == $b != NaN

2001-10-10 Thread Damian Conway
Bart asked: > So to what does "123foo" evaluate in numeric context? Now, it produces > 123. Which is probably useful... Yes. And I would expect that it will continue to do so. Perl is primarily about convenience, not consistency ;-) Damian

Re: EX3: $a == $b != NaN

2001-10-10 Thread Bart Lateur
On Sun, 7 Oct 2001 12:27:17 +1000 (EST), Damian Conway wrote: >The step you're missing is that the non-numeric string "hello", >when evaluated in a numeric context, produces NaN. So: > > "hello" == 0 && 0 != NaN > >is: > > Nan == 0 && 0 != NaN > >which is false. So to what does "

Re: EX3: $a == $b != NaN

2001-10-06 Thread John Siracusa
On 10/6/01 10:27 PM, Damian Conway wrote: >> Doesn't that mean: >> >> "hello" == 0 && 0 != NaN >> >> will evaluate to true? > > No. The step you're missing is that the non-numeric string "hello", > when evaluated in a numeric context, produces NaN. So: > >"hello" == 0 && 0 != NaN

Re: EX3: $a == $b != NaN

2001-10-06 Thread Damian Conway
> $a == $b != NaN > > really means this: > > $a == $b && $b != NaN > > But "$a == $b != NaN" is supposed to "[solve] the problem of numerical > comparisons between non-numeric strings." Well, what if: > > $a = 'hello'; > $b = 0; > > Do

EX3: $a == $b != NaN

2001-10-06 Thread John Siracusa
Okay, so this: 100 < -s $filepath <= 1e6 really means this: 100 < -s $filepath && -s $filepath <= 1e6 which means that this: $a == $b != NaN really means this: $a == $b && $b != NaN But "$a == $b != NaN" is supposed to "[solve] the problem of numerical comparisons between