-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Environment Information
I'm running jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc OpenJDK 64-Bit Server VM 25.252-b09 on 1.8.0_252-b09 +jit [linux-x86_64] from logstash (although I don't think this is a logstash specific problem) on a Linux 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Here's a side-by-side comparison between ruby and jruby, I think the expected behavior should be the later:
ruby -e 'v="661e7086-33af-11eb-a4ef-fa163ec4aef9"; puts(Float(v) rescue v)'returns661e7086-33af-11eb-a4ef-fa163ec4aef9jruby -e 'v="661e7086-33af-11eb-a4ef-fa163ec4aef9"; puts(Float(v) rescue v)'returnsInfinity
I think jruby is parsing "661e7086" from the original the string and interpreting as scientific notation. Although more robust, I don't think is a good behaviour in general (imho jruby should follow ruby).
Thanks a lot for the attention!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels