cremno
4507985c3e
use mrb_bool, FALSE and TRUE more
...
It doesn't matter to me if one is using FALSE/TRUE instead of 1/0
but I prefer a type (alias) which emphasizes boolean vars to int.
I changed 1/0 to FALSE/TRUE anyway.
2014-01-31 18:00:36 +01:00
cremno
18433731ed
remove various preprocessor conditionals
...
- HAVE_IEEEFP_H is nowhere defined or needed at all
- FreeBSD < 4 is unsupported since years
- MSVC workaround (around what exactly?)
2014-01-02 07:33:33 +01:00
Nobuhiro Iwamatsu
01fb0f02d5
Fix typo from expornent to exponent
...
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org >
2013-12-19 09:37:20 +09:00
Carson McDonald
0d0f3545f8
Change supress to suppress
2013-11-09 07:40:51 -05:00
fleuria
e648abf1c1
fix #1542
2013-10-23 15:39:52 +08:00
Yukihiro "Matz" Matsumoto
2607970ed9
move some methods to make floats and integers compatible [mruby special]
2013-10-22 16:18:11 +09:00
Yukihiro "Matz" Matsumoto
620f8b2721
implement some Numeric methods in Ruby
2013-10-22 15:59:41 +09:00
Yukihiro "Matz" Matsumoto
3ae0616710
implement Integer#succ in Ruby
2013-10-21 07:42:50 +09:00
Yukihiro "Matz" Matsumoto
9cb58a2252
Fixnum#succ may overflow
2013-10-20 00:43:39 +09:00
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