in reply to Re^5: Reliably parsing an integer
in thread Reliably parsing an integer
Your solution is interesting, thanks.
The trouble is, I do not really trust the "int $num eq $num;" expression. I have seen that 'int' can do weird things, and I am not convinced that there is no floating-point corner case somewhere on some hardware that spits out something that looks like an integer, because some inaccuracy cancels out when generating a string from it.
Besides, the "eq" is actually converting the integer back to a string, which will cost performance. I think I can write faster code with the steps I outlined above. Stay tuned.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Reliably parsing an integer
by haukex (Archbishop) on Jun 30, 2020 at 09:11 UTC | |
| |
|
Re^7: Reliably parsing an integer
by hippo (Archbishop) on Jun 30, 2020 at 08:55 UTC | |
by rdiez (Acolyte) on Jun 30, 2020 at 10:34 UTC | |
by syphilis (Archbishop) on Jun 30, 2020 at 13:08 UTC | |
|