Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: sub as mathematical function

by ikegami (Patriarch)
on Sep 04, 2019 at 16:29 UTC ( [id://11105611]=note: print w/replies, xml ) Need Help??


in reply to Re: sub as mathematical function
in thread sub as mathematical function

It also fails for a lot of numbers between the ones you tested (e.g. 0.112 should return 1 but returns 0, 0.23 should return 2 but returns 1, etc).

The fix is simple: Replace 8 with 9 :)

Of course, that assumes the input is in range [0..1), but that seems a sure thing.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-26 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found