Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by LanX (Archbishop)
on Sep 20, 2018 at 23:44 UTC ( #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

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

Replies are listed 'Best First'.
Re^2: $var == 1 fails when $var = 1 (lost post)
by syphilis (Bishop) 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 (Bishop) 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
Node Status?
node history
Node Type: note [id://1222765]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2020-02-25 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (113 votes). Check out past polls.

    Notices?