Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: How to check if a variable's value is equal to a member of a list of values

by gnosti (Chaplain)
on Mar 25, 2013 at 18:54 UTC ( [id://1025364]=note: print w/replies, xml ) Need Help??


in reply to Re: How to check if a variable's value is equal to a member of a list of values
in thread How to check if a variable's value is equal to a member of a list of values

I don't see the OP mentioning whether the values to be checked are integer or floating point. Uncertainties in representing floating point values could make hash test useless.
  • Comment on Re^2: How to check if a variable's value is equal to a member of a list of values

Replies are listed 'Best First'.
Re^3: How to check if a variable's value is equal to a member of a list of values
by McA (Priest) on Mar 25, 2013 at 19:31 UTC

    This is an interesting point. Do you know what value is taken for the hash key? The string representation or the floating point binary representation?

    When the first is true than what you said falls in the whole class of floating point related problems, e.g. equality of floats.

    McA

      Do you know what value is taken for the hash key?

      Hash keys are always strings.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-19 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found