Commit Graph

87 Commits

Author SHA1 Message Date
Cremno 123c88759c class.c and numeric.c: fixed MSVC warnings 2013-08-07 20:48:23 +02:00
fleuria 620e323d15 replace assert with mrb_assert 2013-07-25 03:00:03 +08:00
Yukihiro "Matz" Matsumoto 2daf39ddc8 change else formatting 2013-07-22 09:52:06 +09:00
Carson McDonald 9a5e78ae67 Change width to size_t to fix warning 2013-07-06 08:54:18 -04:00
Carson McDonald 5fbceaf4a1 new is removed from Integer so doesn't need to be removed again in Fixnum 2013-06-08 10:38:09 -04:00
kimu_shu e720782f81 Add MRB_WORD_BOXING mode (represent mrb_value as a word) 2013-05-26 10:09:17 +09:00
Yukihiro "Matz" Matsumoto 30d580ecbc rename every ARGS_XXX to MRB_ARGS_XXX; ref #1206 2013-04-25 09:47:36 +09:00
Masaki Muranaka 580f1e922b Integer.round have no arg. 2013-03-31 23:05:23 +09:00
Masaki Muranaka 1d82d07cac Remove unused functions. 2013-03-31 23:05:03 +09:00
Masaki Muranaka cbe7a87c68 Move Integer.{floor,ceil,round,truncate} to mrblib/. For maintainability. 2013-03-31 23:04:45 +09:00
Yukihiro "Matz" Matsumoto 8a2ecba0e4 revive #to_int 2013-03-31 00:06:31 +09:00
Yukihiro "Matz" Matsumoto 918d199efa move to_i from fixnum to integer; remove reference of to_int which is not in ISO 2013-03-30 23:11:30 +09:00
Yukihiro "Matz" Matsumoto 5cc6832626 undef Integer#new; ref #1111 2013-03-30 23:02:15 +09:00
Masaki Muranaka c260ef894e Rename mrb_fix2str() to mrb_fixnum_to_str(). This is for naming consistency. 2013-03-29 22:19:26 +09:00
Masaki Muranaka f82ae7653a Change the second argument of mrb_flo_to_str().
Export mrb_flo_to_str() as API.
2013-03-29 22:19:26 +09:00
Masaki Muranaka 710f625254 Remove mrb_flt2big() as there is no bignum in the core.
Add new API mrb_flo_to_fixnum(). You can replace mrb_flt2big() to mrb_flo_to_fixnum() with few modifications.
2013-03-29 22:19:26 +09:00
Masaki Muranaka 2b5b161f8b Sort include files. Some redundant includes are removed. 2013-03-29 10:22:31 +09:00
Masaki Muranaka a01e968cdb Remove limits.h from numeric.h. Add limits.h to some C files. 2013-03-29 10:06:40 +09:00
Yukihiro Matz Matsumoto 18b2683b97 use new mrb_format API from mrb_raisef; its only format specifier is "%S" (stringify) and takes mrb_value; close #1062 2013-03-27 23:41:23 +09:00
MATSUMOTO Ryosuke 7328b68b9f Adjusted indent, space and tab 2013-03-24 11:35:42 +09:00
Yukihiro Matz Matsumoto f0ac204f21 Use size_t instead of int. This is for portability. 2013-03-24 00:20:35 +09:00
Yukihiro Matz Matsumoto d0d920e909 rename mrb_true_or_false_value() to mrb_bool_value() 2013-03-19 12:03:54 +09:00
Masaki Muranaka 992af98b32 Use mrb_true_or_false_value() / in fix_equal(). 2013-03-19 11:04:22 +09:00
Masaki Muranaka 698e2815ad Use mrb_true_or_false_value() / in flo_finite_p(). 2013-03-19 11:04:22 +09:00
Masaki Muranaka 42ef934da3 Use mrb_true_or_false_value() / in flo_eq(). 2013-03-19 11:04:22 +09:00
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