| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* complex.c: [DOC] fix grammar and typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* complex.c (nucomp_s_new_internal, nucomp_loader): Complex
instances are always frozen now. [Feature #13983]
* rational.c (nurat_s_new_internal, nurat_loader): Rational
instances are always frozen now. [Feature #13983]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (rb_complex_infinite_p): get rid of overflow and
unnecessary multiplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (rb_complex_finite_p): get rid of overflow and
unnecessary multiplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
returns negative value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (rb_complex_set_real, rb_complex_set_imag): remove
functions deprecated at 2.2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* complex.c (f_gt_p): optimize f_gt_p for specific types of arguments.
* internal.h (rb_int_gt, rb_float_gt, rb_rational_cmp): exported.
* numeric.c (rb_float_gt): rename from flo_gt and be exported.
* numeric.c (rb_int_gt): rename from int_gt and be exported.
* rational.c (rb_rational_cmp): rename from nurat_cmp and be exported.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* complex.c (nucomp_f_complex): use nucomp_s_convert directly.
* complex.c (id_convert): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* complex.c (f_negate): optimize for special numeric types.
* complex.c (nucomp_expt): use rb_int_uminus instead of f_negate for
fixnum value.
* internal.h (rb_float_uminus, rb_rational_uminus): exported.
* numeric.c (rb_float_uminus): rename from flo_uminus.
* rational.c (rb_rational_uminus): rename from nurat_negate, and add
assertion for the parameter.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* complex.c (nucomp_abs): use rb_math_hypot directly.
* complex.c (nucomp_arg): use rb_math_atan2 directly.
* complex.c (imp2, m_{atan2,hypot}_bang, m_hypot): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* complex.c (numeric_polar): optimize for Integer, Float, and Rational.
* complex.c (numeric_arg): directly create the value of pi.
* complex.c (f_negative_p): optimize for Integer, Float, and Rational.
* rational.c (INT_NEGATIVE_P): move the definition into internal.h.
* internal.h (INT_NEGATIVE_P): ditto.
* numeric.c (rb_float_abs): rename from flo_abs and export to be used
from other source files..
* internal.h (rb_float_abs): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* complex.c (f_eqeq_p): use rb_equal.
* complex.c (nucomp_eqeq_p): limit return value to true or false,
instead of the result of the other as-is.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
* complex.c (f_negative_p): use rb_num_negative_p instead of funcall.
* complex.c (f_kind_of_p, f_numeric_p): cast down to int because
rb_obj_is_kind_of is safe.
* complex.c (f_signbit, f_tpositive_p): remove f_boolcast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* complex.c (f_zero_p): return int rather than VALUE.
* complex.c (rb_complex_mul): remove needless negate operations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* complex.c (f_one_p): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* complex.c (nucomp_expt): optimize the access to the numerator and
denominator of a rational number.
* complex.c (k_rational_p): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* complex.c (f_addsub, k_complex_p, k_float_p): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* complex.c: refactor to use some specific macros and
to reduce needless conversion by FIX2LONG.
* complex.c (k_fixnum_p, k_bignum_p): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (id_finite_p, id_infinite_p, id_rationalize, id_PI):
initialize static IDs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* complex.c (FINITE_TYPE_P): extract predicate.
* complex.c (rb_complex_finite_p, rb_complex_infinite_p): use
dedicated predicates instead of switch by TYPE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* complex.c (Init_Complex): undefine methods inherited from
Comparable, because Complex does not have <=> method.
[Bug #12866]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* complex.c (Init_Complex): undefine Complex#clamp, which does not
work like other Comparable methods, because Complex does not
have <=> method. patched by Tim Peters <zomg.tim AT gmail.com>
in [ruby-core:77720]. [Bug #12866]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* *.c: rename rb_funcall2 to rb_funcallv, except for extensions
which are/will be/may be gems. [Fix GH-1406]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* numeric.c (num_finite_p, num_infinite_p): Add Numeric#finite? and
Numeric#infinite? [Feature #12039] [ruby-core:73618]
* complex.c (rb_complex_finite_p): Add Complex#finite?
* complex.c (rb_complex_infinite_p): Add Complex#infinite?
* test/ruby/test_bignum.rb: Add test for Integer#finite? and
Integer#infinite?
* test/ruby/test_fixnum.rb: ditto.
* test/ruby/test_rational.rb: Add test for Rational#finite? and
Rational#infinite?
* test/ruby/test_complex.rb: Add test for Complex#finite? and
Complex#infinite?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* math.c (rb_math_sqrt): [EXPERIMENTAL] move Complex sqrt support
from mathn.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (rb_complex_plus, rb_complex_mul): rename to
rb_complex prefix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* include/ruby/ruby.h (RB_INTEGER_TYPE_P): new macro and
underlying inline function to check if the object is an
Integer (Fixnum or Bignum).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
of complex.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* complex.c: Don't refer rb_cFixnum and rb_cBignum.
(k_fixnum_p): Use FIXNUM_P.
(k_bignum_p): Use RB_TYPE_P.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (get_dat1, get_dat2): turn into pure variable
declarations only, not mixed code and declarations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* error.c (rb_assert_failure): assertion with stack dump.
* ruby_assert.h (RUBY_ASSERT): new header for the assertion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
because it defines _LARGE_FILES on AIX and _LARGE_FILES
must be defined before sys/types.h is included from math.h.
[Bug #11483]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* include/ruby/missing.h (M_PI, M_PI_2): fallback definitions for
VC6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
a float but x is not a float.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
| |
* numeric.c (num_positive_p, num_negative_p): add methods
Numeric#positive? and Numeric#negative?.
[ruby-core:69173] [Feature #11151]
* numeric.c (flo_positive_p, flo_negative_p): specialiazed
functions for Float.
* complex.c (Init_Complex): Complex do not have positive? and
negative? methods
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
to remove k_inexact_p macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
* complex.c (safe_mul): get rid of assignments in a macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (rb_nucomp_mul): preserve sign of zeros without NaN by
regularized values.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (rb_nucomp_mul): specialize real numbers and purely
imaginary numbers, and get rid of multiplication by zero.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (f_complex_polar): move optimization for orthogonal
cases from rb_nucomp_mul.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (_USE_MATH_DEFINES): needed for M_PI in Microsoft
Visual C.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* numeric.c (fix_plus, fix_mul): calculate complex numbers for
commutative operations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* complex.c (nucomp_mul): calculate as rotation in complex plane
if matrix calculation resulted in NaN.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
includable without prior inclusion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* complex.c (Init_Complex): provide the feature for backward
compatibility.
* rational.c (Init_Rational): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|