Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: $var == 1 fails when $var = 1 (lost post)

by LanX (Saint)
on Sep 20, 2018 at 23:44 UTC ( [id://1222765]=note: print w/replies, xml ) Need Help??


in reply to $var == 1 fails when $var = 1

Strange, I seem to remember someone (Laurent?) already replying in this thread with this classic link

What Every Programmer Should Know About Floating-Point Arithmetic

Well once again.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^2: $var == 1 fails when $var = 1 (lost post)
by syphilis (Archbishop) on Sep 21, 2018 at 14:55 UTC
    Well once again

    Why ?

    Does that link actually answer either of the 2 issues raised by the OP ?
    Those 2 issues can be paraphrased as:

    1) Why does perl assert that $x is 1 when $x != 1 ?
    2) How is it that $x+$y+$z != $x+$z+$y ?

    Cheers,
    Rob
      primarily b/c I was worried about the lost post.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Re^2: $var == 1 fails when $var = 1
by Your Mother (Archbishop) on Sep 21, 2018 at 01:59 UTC

    o_0 I saw and upvoted that reply from Laurent_R too…

        Nopers. :|

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1222765]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found