matz
fa16110326
* bignum.c (rb_big_fdiv): flo.fdiv(NaN) should result NaN.
...
* numeric.c (num_quo): renamed and moved from bignum.c.
[ruby-dev:34582]
* bignum.c (rb_big_fdiv): update RDoc description
* rational.c (nurat_s_new_m): small refactoring.
* bignum.c (rb_big2dbl): no need for forceful warning when
converting to float. overflow is a nature of float values.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07 04:14:57 +00:00
matz
78008d342e
* test/ruby/test_parse.rb (TestParse::test_void_expr_stmts_value):
...
shut up warning.
* rational.c (nurat_to_f): no need for forceful warning when
converting to float. overflow is a nature of float values.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-01 12:47:07 +00:00
tadf
420a5c994c
* rational (nurat_marshal_load): checks the given
...
denominator. [ruby-dev:34536]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-28 11:28:55 +00:00
tadf
de999ae1fc
* rational.c (nurat_expt): use f_rational_new2. [ruby-dev:34524]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-27 10:02:19 +00:00
nobu
f80616b6d2
* complex.c, rational.c: fixed indent.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22 13:17:04 +00:00
tadf
c08b5dfb81
* lib/cmath.rb: new.
...
* lib/complex.rb: depends lib/cmath.rb.
* lib/rational.rb: added rdiv.
* complex.c: removed some math functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-05 14:25:40 +00:00
matz
228f30be3a
* bignum.c (Init_Bignum): rdiv method removed. [ruby-dev:34242]
...
* complex.c (nucomp_quo): ditto.
* numeric.c (num_rdiv): ditto.
* rational.c (nurat_div): ditto.
* complex.c (nucomp_fdiv): fdiv implementation restored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-03 16:01:16 +00:00
tadf
5d6602c44e
* complex.c (nucomp_int_check): function for DRY real check.
...
* complex.c (nucomp_{add,sub,mul,div,expt}): use rb_num_coerce_bin().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-03 12:55:27 +00:00
matz
c3d2e4d381
* numeric.c (num_rdiv): should always return rational number.
...
* rational.c (nurat_add, nurat_sub, nurat_mul, nurat_fdiv,
nurat_cmp): use rb_num_coerce_bin().
* rational.c (nurat_division): does / and rdiv.
* .gdbinit (rp): no longer use rb_p().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-02 14:13:53 +00:00
matz
f67f196b1d
* rational.c (nurat_int_check): function for DRY integer check.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-02 13:31:42 +00:00
matz
ddf9b405ad
* rational.c: need to include <float.h> just once.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-01 12:21:33 +00:00
tadf
597179bb95
adopted the ruby's style.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-31 16:42:24 +00:00
tadf
459aa9f1c5
revert.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-31 15:19:39 +00:00
matz
88a4961cb2
* numeric.c (num_quo): should convert its operand to Rational.
...
* rational.c (string_to_r_strict): should raise TypeError.
* bignum.c (Init_Bignum): should not redefine Bignum#div.
Numeric#div will do. [ruby-dev:34066]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-31 10:14:42 +00:00
tadf
d4f5cb67d4
* complex.c (f_lcm): removed.
...
* rational.c (rb_lcm, rb_gcdlcm): added.
* lib/complex.rb (gcd, lcm, gcdlcm): removed.
* lib/rational.rb (gcd, lcm, gcdlcm): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-27 11:48:00 +00:00
tadf
76865ca0ec
trivial changes.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-24 13:34:13 +00:00
tadf
6e383d9fa2
fixed. [ruby-dev:34109]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-22 17:31:08 +00:00
tadf
fa59ec2f68
rearrangement.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-20 23:30:34 +00:00
nobu
3aede677ba
* rational.c (nurat_to_f): C99.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-20 21:45:01 +00:00
tadf
5723a8eeb5
improvements.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-20 12:26:58 +00:00
tadf
a3c76eb0c7
added rb_gcd.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-19 13:29:04 +00:00
tadf
80aa946f91
revert.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-19 09:37:39 +00:00
nobu
3f5792a1c6
* complex.c (nucomp_to_s, nucomp_inspect): get rid of making
...
unnecessary intermediate objects.
* complex.c (make_patterns, string_to_c): do not treat successive
underscores as a part of numeric like as literals. [ruby-dev:34085]
* rational.c (make_patterns, string_to_r): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-19 05:53:11 +00:00
tadf
073ee17567
edited comments.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-16 00:51:11 +00:00
tadf
6125552c27
both complex and rational are now builtin classes.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-16 00:23:43 +00:00