aboutsummaryrefslogtreecommitdiffstats
path: root/ext/bigdecimal
Commit message (Collapse)AuthorAgeFilesLines
* * ext/bigdecimal/lib/bigdecimal/math.rb (atan): atan(Infinity) isnobu2009-09-231-13/+7
| | | | | | | PI/2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/math.rb (atan): reduce loop withnobu2009-09-231-1/+5
| | | | | | | | the formula of the double corner. based on a patch from Masahiro Kanai (CanI) in [ruby-dev:39367]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/math.rb (atan): refined.nobu2009-09-231-0/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/{ludcmp,math}.rb: depend onnobu2009-09-212-0/+4
| | | | | | | bigdecimal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/newton.rb: rdoc needs to benobu2009-09-211-3/+3
| | | | | | | followed by the definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/*.rb: made module functions.nobu2009-09-214-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/*.rb: fixed indent.nobu2009-09-213-42/+42
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (GetVpValue): support conversion fromnobu2009-09-211-0/+15
| | | | | | | Rational. [ruby-core:25697] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_remainder): Doc fix [ruby-core:18796]marcandre2009-09-211-4/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/math.rb (sin, cos, atan, exp, log):nobu2009-09-201-5/+31
| | | | | | | | improved precision and performance. based on a patch from Makoto Yamashita in [ruby-core:25600] and [ruby-core:25602]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_data_type): typed.nobu2009-09-091-5/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal.c: moved BASE_FIG definition before it is used first time.azav2009-07-251-18/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): went infinity toomatz2009-06-181-1/+1
| | | | | | early. add BASE_FIG margin. [ruby-dev:38673] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (gfCheckVal): never used.nobu2009-06-112-12/+14
| | | | | | | | | * ext/bigdecimal/bigdecimal.c (VpInit): fixed format modifiers. * ext/bigdecimal/bigdecimal.c (VPrint): constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): returns Inf ifmatz2009-05-311-3/+5
| | | | | | exp is bigger than DBL_MANT_DIG. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_coerce): supportmatz2009-05-101-5/+10
| | | | | | coercing into Rational. [ruby-core:23415] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-063-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (gfDebug): uncommented out.nobu2009-03-011-1/+1
| | | | | | | [ruby-core:22600] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpToString): reverted modificationmatz2008-12-161-7/+13
| | | | | | | | | (that caused a bug) in r20359. [ruby-dev:37370] * ext/bigdecimal/bigdecimal.c (BigDecimal_limit): comment update. [ruby-dev:37465] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_round): should be roundmatz2008-12-101-2/+5
| | | | | | | | | to integer. [ruby-dev:37355] * ext/bigdecimal/bigdecimal.c (BigDecimal_divmod): division should be integer. [incompatible] [ruby-dev:37355] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_truncate): returnmatz2008-12-081-0/+9
| | | | | | | | | | integer if no optional argument given. [incompatible] * ext/bigdecimal/bigdecimal.c (BigDecimal_floor): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimal_ceil): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): bigdecimalmatz2008-11-271-4/+3
| | | | | | | division (including modulo) should raise ZeroDivisionError as integer division. [incompatible] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): should returnmatz2008-11-271-1/+4
| | | | | | | | | Integer for #div operation. * ext/bigdecimal/bigdecimal.c (BigDecimal_div2): should raise ZeroDivisionError if divisor is zero. [ruby-dev:37207] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpException): bigdecimal zeromatz2008-11-262-8/+7
| | | | | | | | | | division should raise FloatDomainError if mode VP_EXCEPTION_ZERODIVIDE is set. [ruby-dev:37204] * ext/bigdecimal/bigdecimal.c (BigDecimal_mode): should handle VP_EXCEPTION_ZERODIVIDE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_to_r): raise exceptionmatz2008-11-251-12/+15
| | | | | | | | for nan/inf conversion. [ruby-dev:37187] fix #793 * ext/bigdecimal/bigdecimal.c (BigDecimal_to_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpAlloc): avoid ALLOCA_N() to avoidmatz2008-11-251-42/+54
| | | | | | | | | | | | | | segmentation fault caused by (insanely) long decimal values. [ruby-dev:37189] fix #794 * ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_to_i, BigDecimal_to_f, BigDecimal_to_s, BigDecimal_split, BigDecimal_inspect): ditto. * ext/bigdecimal/bigdecimal.c (VpToString): small performance improvement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_to_r): moved frommatz2008-11-112-12/+36
| | | | | | bigdecimal/util, converted into C. [ruby-dev:36805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * prec.c: removed. Precision will be redesigned and be back again.yugui2008-09-191-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c.f. [ruby-dev:36352]. * common.mk (COMMON_OBJS): removed prec.o. * inits.c (rb_call_inits): removed Init_Precision. * numeric.c (Init_Numeric): removed inclusion of Precision. removed #induced_from from each class. * rational.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * lib/rdoc/knwon_classes.rb: removed the entry for Precision. * test/ruby/test_prec.rb: removed. * test/ruby/test_integer.rb: removed tests for Precision. * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_float.rb: ditto. * test/ruby/test_rational.rb: ditto. * test/ruby/test_complex.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpCtoV): 1E1000...000 is interpreted asmame2008-09-181-3/+20
| | | | | | | | | | | | Infinity. [ruby-dev:36159] * ext/bigdecimal/bigdecimal.c (VpPower): Infinity ** 1 returns Infinity instead of NaN. [ruby-dev:36159] * test/bigdecimal/test_bigdecimal.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_mode): set exception modemame2008-09-041-0/+6
| | | | | | | | correctly. In spite of BigDecimal.mode(BigDecimal::EXCEPTION_ALL, true), BigDecimal.new("NaN") did not raise an exception previously. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpMult): fix double free.mame2008-08-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): should not ignorematz2008-08-121-1/+1
| | | | | | <=> comparison. [ruby-dev:35732] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpMult): prevent memory leak.mame2008-07-311-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpIsRoundMode): fix tautologymame2008-07-301-3/+3
| | | | | | | condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): fix typo.mame2008-07-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): BigDecimal#<=> shouldmame2008-07-222-2/+10
| | | | | | | | | | return nil if an argument can't be coerced into BigDecimal. * ext/bigdecimal/bigdecimal.h, ext/bigdecimal/bigdecimal.c (VpIsNegDoubleZero, VpItoV): comment out unused functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c: include ieeefp.h to refer isinf.mame2008-07-021-0/+4
| | | | | | | | | | | * ext/bigdecimal/bigdecimal.c: ditto. * ext/json/ext/generator/generator.c: ditto. * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/jacobian.rb (Jacobian::dfdxi):matz2008-06-201-1/+1
| | | | | | typo fixed (raize -> raise). [ruby-list:45101] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (rb_num_coerce_bin): add ID argument to specifymatz2008-02-121-8/+21
| | | | | | | | | | | | caller's method name. [ruby-dev:33663] * numeric.c (rb_num_coerce_cmp): ditto. * numeric.c (rb_num_coerce_relop): ditto. * ext/bigdecimal/bigdecimal.c (DoSomeOne): add function name argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/extconf.rb: simplified the condition.nobu2008-02-091-3/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): use strtod() for morenobu2008-02-092-27/+42
| | | | | | | | | | | precision. [ruby-talk:290296] * ext/bigdecimal/bigdecimal.c (BASE_FIG): made constant. * ext/bigdecimal/extconf.rb: ditto. [ruby-dev:33658] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpMidRound): Round method bugmatz2007-12-211-2/+8
| | | | | | | pointed by Ryan Platte fixed(Patch to the patch from "NATORI Shin"). [ruby-talk:273360] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby: moved public headers.nobu2007-06-101-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c: BigDecimal("-.31") is nowmatz2007-03-141-1/+1
| | | | | | treated as ("-0.31") not as ("0.31"). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_load): Silence warningsknu2007-02-271-2/+2
| | | | | | | | | | | | | | | regarding char * vs. unsigned char * mismatch; submitted by Lyle Johnson <lyle.johnson@gmail.com> in [ruby-core:10416]. * ext/digest/sha1/sha1ossl.c (SHA1_Finish): Ditto. * ext/digest/rmd160/rmd160ossl.c (RMD160_Finish): Ditto. * ext/digest/digest.c (rb_digest_base_finish, rb_digest_base_update): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update constant comments to provide values for RDoc.drbrain2006-12-311-25/+43
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c: remove useless method BigDecimal#!=. ↵aamine2006-12-251-12/+0
| | | | | | [ruby-dev:30050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_warning, parser_warn): some error message maymatz2006-10-141-2/+2
| | | | | | | | | | | | | | | | contain format specifiers. a patch from Akinori MUSHA <knu at iDaemons.org>. [ruby-dev:29657] * regparse.c (onig_rb_warning, onig_rb_warn): ditto. * ext/bigdecimal/bigdecimal.c (VpException): ditto. * ext/dl/handle.c (rb_dlhandle_initialize): ditto. * ext/gdbm/gdbm.c (rb_gdbm_fatal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.h (struct RString): embed small strings.matz2006-08-311-9/+9
| | | | | | | | | | (RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c, ext/digest/rmd160/rmd160ossl.c,matz2006-08-071-1/+1
| | | | | | | | | ext/digest/sha1/sha1ossl.c, ext/readline/readline.c: move incluion of config.h to pacify AIX. a patch from Yutaka Kanemoto <kinpoco at gmail.com>. [ruby-dev:29197] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e