summaryrefslogtreecommitdiffhomepage
path: root/test/t/float.rb
AgeCommit message (Collapse)Author
2021-03-18`Float::NAN/0` should be `Float::NAN`; ref a0b3378b3KOBAYASHI Shuji
#### Before this patch: ```console $ bin/mruby -e 'p(Float::NAN/0)' Infinity ``` #### After this patch (same as Ruby): ```console $ bin/mruby -e 'p(Float::NAN/0)' NaN ```
2021-01-17Add tests for `Integer#quo` and `Float#quo`; #5268Yukihiro "Matz" Matsumoto
2020-11-21Update `Float#to_s` to keep trailing zero as CRuby does; ref 68cebb6Yukihiro "Matz" Matsumoto
2020-10-12Always add trailing `.0` in `Float#inspect`; ref #4225KOBAYASHI Shuji
Trailing `.0` is removed from `Float#to_s` and `Float#inspect` at 9d08025b. However, I think the more human-readable format is better for `Float#inspect`. For example, in the `Float#to_s` format, the failure message is not well understood when testing values including types by `eql?` (e.g. `Numeric#step` test). ```ruby assert "example" do exp = 1.0 act = 1 assert_operator(exp, :eql?, act) #=> Expected 1 to be eql? 1. end ```
2020-10-12Rename float configuration option names.Yukihiro "Matz" Matsumoto
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general.
2019-09-07Revert part of #4225Yukihiro "Matz" Matsumoto
Since in mruby, Integer and Float interchange frequently (mostly on overflow), so adding explicit `.0` can cause problems sometimes. For example: https://github.com/mattn/mruby-json/pull/40 https://github.com/pepabo/mruby-msd/pull/13 https://github.com/mattn/mruby-json/pull/42
2019-04-23Fix "ambiguous first argument" warning in `test/t/float.rb`KOBAYASHI Shuji
2019-04-22Add `assert_predicate` and `assert_operator`KOBAYASHI Shuji
2019-03-25Update float test values to avoid precision errors.Yukihiro "Matz" Matsumoto
2019-03-25Avoid infinite binary floating numbers in `float`.Yukihiro "Matz" Matsumoto
2019-03-21Fix `Float#eql?`KOBAYASHI Shuji
2019-03-15Avoid using infinite binary floating point numbers in tests.Yukihiro "Matz" Matsumoto
2019-01-13Improve compatibility to CRuby for `Float#to_s`KOBAYASHI Shuji
Bfore: Float::INFINITY.to_s #=> "inf" 50.0.to_s #=> "50" 1e20.to_s #=> "1e+20" After / CRuby: Float::INFINITY.to_s #=> "Infinity" 50.0.to_s #=> "50.0" 1e20.to_s #=> "1.0e+20"
2019-01-03Remove `Kernel#class_defined?` which is not available in CRuby; #3829Yukihiro "Matz" Matsumoto
2017-12-13Skip `test/t/float.rb` tests; ref #3827Yukihiro "Matz" Matsumoto
2017-03-29Should raise FloatDomainErrorksss
2015-11-06fix ambiguous first argument warningcremno
/home/travis/build/mruby/mruby/test/t/float.rb:201:17: ambiguous first argument; put parentheses or even spaces
2015-09-02Float << and >> should be more compatible to FixnumYukihiro "Matz" Matsumoto
2014-06-15Move direct superclass checking to `test/t/superclass.rb`.take_cheeze
2014-03-21Float#round fix bug for infinity and nan casesksss
2014-03-16float + nil should be raise TypeErrorksss
2014-03-04Fix Float#divmod.Tomoyuki Sahara
2014-02-03add Float#nan?Tomoyuki Sahara
2013-08-02I fix order of actual and expect test value in float.rb.Jun Hiroe
2013-06-14Fix float parenthese warningDaniel Bovensiepen
2013-06-14Improve Float TestsDaniel Bovensiepen
2012-11-20Use check_float when testing equality for float valuesXuejie Xiao
2012-08-01float do not have enough precision to round if MRB_USE_FLOAT is setYukihiro Matsumoto
2012-07-22add test cases for floor, inifinite?, truncate, ceil, and roundAkira Kuroda
2012-06-03Add more superclass testsDaniel Bovensiepen
2012-05-29Add Test cases for Literals, Enumeration, Exceptions and clean line endingsDaniel Bovensiepen
2012-05-23test t/*.rb spacing fixYukihiro Matsumoto
2012-05-19Finish all Float ISO TestsDaniel Bovensiepen