Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Perl
Perl Misc
Compare, two identical numbers are not the same?!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Justin C, post: 4866993"] Being self-taught this had passed me by (I'm not qualified to teach Perl you see, that's why my education was lacking this nugget - among others). OK. I can be certain that a user will never put in a number using more than two decimal places - if they do I can reject it. Would I be better off multiplying the input data by 100 and working in integars only? Then dividing by 100 only when I need the "real" number? It sure looks like it would make life easier. On the other hand, the sprintf trick works. Maybe I should just try and remember not to compare floats - that's obviously the best solution because it'll save me asking again in the future. Maybe, when I write my end of term report for myself, I should mention this, maybe I'll remember it when I read what my teacher says about me. Not *that* surprised. :) (at least, not after reading this thread!). Justin. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
Compare, two identical numbers are not the same?!
Top