diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-01-08 20:31:29 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-01-08 20:43:23 +0900 |
| commit | 68735d12614ef72b620736a5cd3052fb79445483 (patch) | |
| tree | b829d0e0e27fb250f9df3b873df2e253043c1efd /include | |
| parent | 817436c33b556ba4129ae6cf45998d51ff7b9351 (diff) | |
| download | mruby-68735d12614ef72b620736a5cd3052fb79445483.tar.gz mruby-68735d12614ef72b620736a5cd3052fb79445483.zip | |
Fix dump/load float leteral evaluate to infinity
Example:
# example.rb
p(2e308)
p(-2e308)
Good:
$ bin/mruby example.rb
inf
-inf
Bad:
$ bin/mrbc example.rb
$ bin/mruby -b example.mrb
0
-0
Cause:
Float infinity representation is `inf` on dump and it is converted by
corresponding `String#to_f` on load.
Treatment:
- Introduce new representations (`i`: +infinity, `I`: -infinity)
- Allow old representations (`inf`, `-inf`, `infinity`, `-infinity`) too
- Raise error for unknown representations (use corresponding `Kernel#Float`)
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
