Commit Graph

158 Commits

Author SHA1 Message Date
David Turnbull 249f05e7d7 Clean up value.h and mrb_value boxing 2014-07-09 06:32:11 +09:00
take_cheeze a50464fe01 Fix type checking in mrb_flo_to_fixnum. 2014-07-04 16:16:06 +09:00
yui-knk 76593ee0e7 Add comment to Fixnum Class. 2014-05-17 13:51:16 +09:00
Carson McDonald 01988e3be7 Make sure c is large enough if there is an overflow 2014-05-13 11:46:29 -04:00
Yukihiro "Matz" Matsumoto c12f64271a fix overflow error like #2244 on MRB_WORD_BOXING 2014-05-13 23:15:44 +09:00
Akira Kuroda c445c6c7da refactor fix_mod
fix unreachable condition
use b
2014-05-05 23:43:37 +09:00
cremno cf8df563c0 add function for checked mrb_int subtraction 2014-05-05 15:28:26 +02:00
cremno 0f39304265 add function for checked mrb_int addition 2014-05-05 15:24:22 +02:00
cremno 86cfcd20d6 simply use isfinite 2014-05-04 01:50:17 +02:00
Jun Hiroe 129e5a6c21 Refactor rshift 2014-05-03 01:13:43 +09:00
Nobuyoshi Nakada ab67c57f65 remove trailing spaces 2014-04-30 09:50:14 +09:00
Jun Hiroe 68ce209f7e Refactor fix_xor() 2014-04-26 11:52:45 +09:00
Jun Hiroe 8916381dba Refactor fix_or() 2014-04-26 11:52:45 +09:00
Jun Hiroe c2d46a43b2 Refactor fix_and() 2014-04-26 11:52:45 +09:00
Jun Hiroe 1bf4633ced Refactor flo_finite_p() 2014-04-26 11:52:45 +09:00
Jun Hiroe cdb49ab608 Refactor fix_to_f in numeric.c 2014-04-16 13:42:40 +09:00
Jun Hiroe 212b3409ae Refactor lshift in numeric.c 2014-04-16 13:42:40 +09:00
Jun Hiroe 0823b23623 Refactor fix_shift_get_width in numeric.c 2014-04-16 13:42:40 +09:00
Yukihiro "Matz" Matsumoto 5138f62d6b resolve conflict 2014-04-15 10:55:46 +09:00
Yukihiro "Matz" Matsumoto 6c02935eb1 Merge branch 'master' of github.com:mruby/mruby 2014-04-13 17:34:27 +09:00
Yukihiro "Matz" Matsumoto b631e0f8d5 avoid function style parens after "return"; ref #2055 2014-04-13 17:34:06 +09:00
Jun Hiroe 70e93da724 Fix indent in bit_coerce 2014-04-13 03:11:58 +09:00
Jun Hiroe 996343caa2 Refactor fix_rshift 2014-04-13 00:41:22 +09:00
Jun Hiroe f8e1633c0d Refactor fix_lshift 2014-04-13 00:37:55 +09:00
Jun Hiroe 8496f84b9b Refactor fix_rev 2014-04-12 23:45:22 +09:00
Yukihiro "Matz" Matsumoto bff93ba93f simplify Fixnum#== 2014-04-12 16:38:28 +09:00
Yukihiro "Matz" Matsumoto 1ef77ab3ff simplify Numeric#eql? 2014-04-12 16:30:45 +09:00
Yukihiro "Matz" Matsumoto 8321ad3f56 remove num_equal() that potentially cause infinite loop 2014-04-12 16:08:47 +09:00
Yukihiro "Matz" Matsumoto b20d711c4d Numeric#round takes optinal argument; close #2042 2014-04-11 14:22:48 +09:00
Yukihiro "Matz" Matsumoto 514cafe6c3 do not use "to_f" to retrieve floats in mrb_get_args(); close #1965 2014-03-28 11:04:15 +09:00
ksss 8891cea41c Float#round fix bug for infinity and nan cases 2014-03-21 22:24:33 +09:00
Masaki Muranaka 1df355e300 Reduce implicit type casts. 2014-03-18 17:36:47 +09:00
Yukihiro "Matz" Matsumoto e4ae3bf661 Merge pull request #1871 from ksss/numeric-plus
fix bug when `0 + other object`
2014-03-17 00:14:42 +09:00
Yukihiro "Matz" Matsumoto 5140e27b5a Merge pull request #1872 from ksss/numeric-mul
fix bug when `0 * other object`
2014-03-17 00:14:16 +09:00
ksss 0fab9d557e float + nil should be raise TypeError 2014-03-16 23:39:58 +09:00
ksss 9dcce29749 fix bug when 0 * other object 2014-03-16 23:08:31 +09:00
ksss e9f3dca0f4 fix bug when 0 + other object 2014-03-16 22:52:25 +09:00
cremno 1b6a4fb5a2 add MRB_INT_BIT 2014-03-11 20:14:18 +01:00
cremno f57b9d1576 use NAN and INFINITY
The macro str_to_mrb_float (strto[df]) converts a string to a number,
but these two macros can be used to directly get the special value.

The NAN macro requires quiet NaN support, but so does str_to_mrb_float.

This change also circumvents missing C99 support in Microsoft's C library.
Its (or ISO C90's) strtod doesn't parse "nan" or "inf".
2014-03-08 17:25:07 +01:00
Yukihiro "Matz" Matsumoto d747ea72c4 resolve conflict 2014-02-26 00:06:58 +09:00
Yukihiro "Matz" Matsumoto c636386953 avoid accessing uninitialized string; ref ac936fc 2014-02-25 00:47:02 +09:00
Yukihiro "Matz" Matsumoto 46ee883574 move declaration to the top of the block; ref #1727 2014-02-23 20:41:15 +09:00
h2so5 b0e3b873f5 preserve significands in float-string conversion 2014-02-22 16:50:52 +09:00
Yukihiro "Matz" Matsumoto ac936fc211 powered num may be infinite in float-string conversion 2014-02-22 11:06:38 +09:00
cremno 61577e8d6b mrb_flo_to_str: internal linkage 2014-02-18 04:37:35 +01:00
cremno 1838099e00 more mrb_flo_to_str fixes
- remove float check (take mrb_float instead of mrb_value)
- support -0.0
- fix range error if log10 is called when n == 0.0
- MSVC older than 2013: add signbit macro (for double)
2014-02-17 12:37:39 +01:00
Yukihiro "Matz" Matsumoto 57b7f6b619 use double instead of mrb_float (that may be single precision float) to reduce errors 2014-02-17 10:20:58 +09:00
Yukihiro "Matz" Matsumoto eacdcc13d8 remove trailing zeros from float string representation 2014-02-17 10:11:51 +09:00
Yukihiro "Matz" Matsumoto a740b28b52 define FLO_EPSILON depends on float/double 2014-02-17 09:47:39 +09:00
Yukihiro "Matz" Matsumoto 4b981adc58 remove max_digit from mrb_flo_to_str() 2014-02-17 09:40:30 +09:00