Commit Graph

62 Commits

Author SHA1 Message Date
Masaki Muranaka db9fc2be8d Use mrb_true_or_false_value() / in num_eql(). 2013-03-19 11:04:22 +09:00
Yukihiro Matz Matsumoto a4c30b93ac personal style preference on function call in flo_to_s 2013-03-18 22:54:26 +09:00
Masaki Muranaka 9be437c6d5 Add a new function mrb_flo_to_str(). Use it instead of sprintf() as possible. 2013-03-17 02:31:40 +09:00
Masaki Muranaka fd69e271bb Add float.h. It exists even if the environment was freestanding. It has been supported since C89. 2013-03-17 02:31:40 +09:00
Masaki Muranaka 3aa3b4af90 Remove stdlib.h from mruby.h. It is for portability (care for freestanding environments).
This is a first step. It will be reduced stdlib.h in each files later.
2013-03-16 21:29:39 +09:00
Masaki Muranaka 5a025813b5 Include stdio.h in mrbconf.h instead of C extension sources. 2013-03-05 01:38:51 +09:00
Masaki Muranaka 6cd7017ec1 Remove trailing whitespaces. This is just a cosmetic change. 2013-03-03 10:54:00 +09:00
Yukihiro "Matz" Matsumoto 58b9e76724 Merge pull request #872 from monaka/pr-fix-mrb_fix2str
Fix mrb_fix2str().
2013-02-22 19:07:07 -08:00
Masaki Muranaka 4c96817410 Cleanup shift operations. 2013-02-23 11:42:27 +09:00
Masaki Muranaka 9ea0b4b7d1 Fix an underlying bug. flodivmod() will be crashed in case ((y == 0) && ((divp == NULL) || (modp == NULL))). 2013-02-23 11:42:27 +09:00
Masaki Muranaka 82313b6ec7 Add a comment. 2013-02-23 11:42:27 +09:00
Masaki Muranaka 11997dd0ab Remove a comment at an unsuitable place. 2013-02-23 11:42:27 +09:00
Masaki Muranaka 316faf6790 Cosmetic changes. Just added empty lines. 2013-02-23 11:42:27 +09:00
Masaki Muranaka 9acc753297 Fix mrb_fix2str() to enable handling some negative values correctly. This fix is based on @cremno's hack. It will fix #869. 2013-02-23 09:38:55 +09:00
Masamitsu MURASE 641fc9902f Prevent overflow of Fixnum#to_s. 2013-02-03 16:32:30 +09:00
Yuichiro MASUI 9375138573 l/rshift width as int. It was unsigned long 2012-11-17 15:57:01 +09:00
Yukihiro Matz Matsumoto 7cea9d7b94 int and mrb_int should not be mixed under -DMRB_INT64; may fix #557 2012-11-17 02:16:35 +09:00
Yukihiro Matz Matsumoto da88627a37 add mrb_float_p() 2012-11-04 04:51:13 +09:00
Yukihiro Matz Matsumoto 3ba521ae9e replace FIXNUM_P() by mrb_fixnum_p() 2012-11-04 04:49:43 +09:00
Yuichiro MASUI 15f46a1feb define convert method mrb_int/mrb_float with C string 2012-10-27 14:26:50 +09:00
Masaki Muranaka 6069a33089 mrb_raisef(): new function. Same as previou version of mrb_raise().
mrb_raise(): API modified. It cannot treat variable arguments.
2012-10-23 09:42:22 +09:00
Yukihiro Matsumoto ac3b1c4c5a lshift must not assume sizeof(long) >= sizeof(mrb_int) 2012-10-19 01:50:40 +09:00
Yukihiro Matsumoto 1bf70ea255 1.divmod(0) should not crash, but return [Inf,NaN] (CRuby incompat); close #492 2012-10-16 21:18:28 +09:00
Yukihiro Matsumoto eb080397fa zero check added to mrb_fixnum_mul as well 2012-09-03 22:22:57 +09:00
Yukihiro Matsumoto 26ac77af9b make Kernel#inspect not to call #to_s 2012-09-03 00:49:34 +09:00
Yukihiro Matsumoto d6bd191cc4 remove stupid debug print 2012-08-01 00:46:27 +09:00
Yukihiro Matsumoto 0270d11c81 float do not have enough precision to round if MRB_USE_FLOAT is set 2012-08-01 00:45:12 +09:00
Max Anselm ea25912999 Undefine new for class rather than instance.
Applies to NilClass, TrueClass, FalseClass, Fixnum, and Float. Add
mrb_undef_class_method for DRYness.
2012-07-25 18:22:26 -04:00
Junji Sawada 96366117ea Remove unnecessary header inclusion 2012-07-14 11:39:25 +09:00
Masaki Muranaka 21f2e5364b Use mrb_str_new() instead of mrb_str_new2() as possible. 2012-06-22 17:02:08 +09:00
Masamitsu MURASE e5e2ebf15a fix binary minus function of Fixnum '0'. 2012-06-17 22:32:07 +09:00
Yukihiro Matsumoto 040b57fae5 1 % 0 should return NaN; close #283 2012-06-15 08:36:07 +09:00
Yukihiro Matsumoto 8e574a9e74 integer overflow in fixnum plus and minus 2012-06-13 19:05:33 +09:00
Yukihiro Matsumoto 2ded555a91 could not print 0xffffffff as an negative fixnum 2012-06-13 17:59:37 +09:00
Yukihiro Matsumoto 38d2b7f84c float representation simplified 2012-06-13 15:51:28 +09:00
Yukihiro Matsumoto db3d72a471 move RSHIFT from numeric.h to numeric.c 2012-06-13 15:40:41 +09:00
Yukihiro Matsumoto 6a5019d37f optimized OP_{ADD,SUB,MUL,DIV} to use numeric function for fixnums to handle overflow 2012-06-13 15:38:18 +09:00
Yukihiro Matsumoto 3e8d330c2c remove #new from immediate classes 2012-05-31 11:11:55 +09:00
Yukihiro Matsumoto 0e5958d404 rename ruby_digitmap to mrb_digitmap 2012-05-30 21:19:04 +09:00
Yukihiro Matsumoto d9227aa41d remove ZeroDivisionError since mruby gives float for integer division 2012-05-24 21:10:23 +09:00
Yukihiro Matsumoto ad9e841c53 made mrb_get_args() better (optinal args, type checks); close #173 #176 2012-05-24 01:09:36 +09:00
Yukihiro Matsumoto f44acf7bf8 explicit normalization -0.0 to 0.0 2012-05-23 02:18:40 +09:00
Yukihiro Matsumoto 74e531ecab avoid isfinite() in num_pow 2012-05-17 10:34:28 +09:00
Masaki Muranaka c6f0e296bd Remove some redundant function declarations. 2012-05-16 14:31:48 +09:00
Yukihiro Matsumoto bd839684e5 numeric division to return float value 2012-05-15 18:24:58 +09:00
Yukihiro Matsumoto 3b53b3be68 add Numeric#** 2012-05-15 16:40:57 +09:00
Yukihiro Matsumoto f4cf8ea423 partial VC support 2012-05-09 08:49:38 +09:00
Yukihiro Matsumoto 2e4e7f7cd1 should not call round(3); close #109 2012-05-09 08:18:39 +09:00
Yukihiro Matsumoto e1f7617ff6 numeric.c: big restructuring; coercing removed, indentation fixed, unnecessary code removed 2012-05-02 08:51:43 +09:00
Yukihiro Matsumoto f373169af0 numeric.c: remove dependency to encoding.h 2012-05-02 00:10:18 +09:00