John Bampton
ea8964ef35
ruby: standardize whitespace
2022-10-31 16:25:56 +10:00
Yukihiro "Matz" Matsumoto
bf5bbf0a4b
test/integer: test negative integer divisions; ref #5678
2022-03-26 11:26:57 +09:00
Yukihiro "Matz" Matsumoto
fe03e01078
numeric.c: enhance integer division to support Rational and Complex.
...
No longer need to override division methods in mrbgems.
2022-03-18 12:27:46 +09:00
Yukihiro "Matz" Matsumoto
4d249c28d9
Skip tests that use Float inside; ref #5421
2021-04-24 12:04:08 +09:00
Yukihiro "Matz" Matsumoto
f4a3dc4f07
Add tests for Integer#quo and Float#quo; #5268
2021-01-17 23:02:36 +09:00
John Bampton
4fa3359d44
refactor: remove trailing whitespace from C, Header, Ruby and YAML files
...
Lint
2020-12-15 19:44:02 +10:00
Yukihiro "Matz" Matsumoto
19450df41e
Integer operation should result in Integer.
...
Should raise `RangeError` if the operation overflows.
2020-11-14 19:38:27 +09:00
Yukihiro "Matz" Matsumoto
2b188ed8a1
Reorganize Integer system.
...
- Integrate `Fixnum` and `Integer`
- Remove `Integral`
- `int / int -> int`
- Replace `mrb_fixnum()` to `mrb_int()`
- Replace `mrb_fixnum_value()` to `mrb_int_value()`.
- Use `mrb_integer_p()` instead of `mrb_fixnum_p()`
2020-10-12 18:19:54 +09:00
dearblue
80fe9838d2
Integrate Fixnum class into Integer class
...
* The `Fixnum` constant is now an alias for the `Integer` class.
* Remove `struct mrb_state::fixnum_class` member.
If necessary, use `struct mrb_state::integer_class` instead.
2020-10-12 16:21:44 +09:00
KOBAYASHI Shuji
549317a36b
Fix Fixnum overflow test in Integer#<< test
...
- Skip when `MRB_WITHOUT_FLOAT` is defined.
- Make `Fixnum` overflow even when `MRB_INT64` is defined.
2019-09-23 21:59:35 +09:00
KOBAYASHI Shuji
2f7175442f
Fix Fixnum#(to_s|inspect) argument specs
...
Before this patch:
$ bin/mruby -e 'p 3.to_s(2)'
trace (most recent call last):
[0] -e:1
-e:1: 'to_s': wrong number of arguments (1 for 0) (ArgumentError)
After this patch:
$ bin/mruby -e 'p 3.to_s(2)'
"11"
2019-09-17 09:28:51 +09:00
KOBAYASHI Shuji
de5da4b7f6
Fix coercing for first step counter in Numeric#step
...
Before:
a=[]; 7.step(4, -3.0) { |c| a << c }; p a #=> [7, 4.0]
After / Ruby:
a=[]; 7.step(4, -3.0) { |c| a << c }; p a #=> [7.0, 4.0]
2019-01-15 21:41:54 +09:00
Yukihiro "Matz" Matsumoto
cca19532c5
Remove Kernel#class_defined? which is not available in CRuby; #3829
2019-01-03 11:34:35 +09:00
YAMAMOTO Masaya
dcd5d0ffec
Test for MRB_WITHOUT_FLOAT
2017-10-11 17:58:11 +09:00
Zachary Scott
3f228c1da4
Fix "ambiguous first argument" warning
2015-12-17 00:12:19 +09:00
murase_syuka
ef95dcd390
Bugfix nagative-number lshift() bit overflow
2015-11-18 21:37:17 +09:00
murase_syuka
a4d5588101
Bugfix lshift() bit overflow; close #3023
2015-11-18 01:00:46 +09:00
Yukihiro "Matz" Matsumoto
3a462fe468
Integer << and >> to use Float instead of raising RangeError
2015-09-02 23:41:51 +09:00
Miura Hideki
eb3af3752f
Fix to avoid warning
2015-04-17 20:04:07 +09:00
Miura Hideki
a21d3f627e
Add test of negative arguments for Integer#%
2015-04-17 17:26:12 +09:00
take_cheeze
ec5b055694
Move direct superclass checking to test/t/superclass.rb.
2014-06-15 15:02:21 +09:00
yui-knk
b9e9ce9237
Add ISO No. to Integer#divmod test.
2014-05-14 08:48:04 +09:00
Yukihiro "Matz" Matsumoto
15a2003aeb
Merge pull request #2190 from cremno/mrbtest-mrb_int-constants
...
test fixnum overflow for add, sub and mul
2014-05-13 18:16:52 +09:00
yui-knk
935a4ccce7
Fix ISO No.
2014-05-13 09:48:02 +09:00
cremno
964ce6e327
test fixnum overflow for add, sub and mul
2014-05-05 00:19:08 +02: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
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
Tomoyuki Sahara
6e1f4695aa
add tests for Integer#divmod.
2014-03-04 10:51:56 +09:00
Jun Hiroe
19dce63a2d
I fix order of actual and expect test value in integer.rb.
2013-08-02 20:54:22 +09:00
Carson McDonald
1d27d4e03f
Add a few more shift tests
2013-07-06 08:53:40 -04:00
Daniel Bovensiepen
b55958b4fa
Improve Integer Tests
2013-06-15 00:11:12 +08:00
Daniel Bovensiepen
b4647224b7
Add test case for Integer#step
2012-09-15 17:13:56 +09:00
Daniel Bovensiepen
0c2d74020a
Add more superclass tests
2012-06-03 23:31:53 +08:00
Daniel Bovensiepen
31e9705022
Add Test cases for Literals, Enumeration, Exceptions and clean line endings
2012-05-29 01:20:46 +08:00
Yukihiro Matsumoto
52b2d092d3
test t/*.rb spacing fix
2012-05-23 12:00:49 +09:00
Daniel Bovensiepen
2331738c21
Complete Integer Tests for ISO
2012-05-19 00:44:43 +08:00
Daniel Bovensiepen
241d3f7eb3
Add Tests for Integer
2012-05-16 11:18:42 -07:00