Граф коммитов

268 Коммитов

Автор SHA1 Сообщение Дата
zzak 54a22fb8c7 * ext/bigdecimal/bigdecimal.c: Update overview formatting of headers
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-15 01:20:27 +00:00
zzak 184eaedb3a * ext/bigdecimal/bigdecimal.gemspec: Update authors
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-15 01:19:30 +00:00
zzak 51c43dba6a * ext/bigdecimal/*: improve documentation, nodoc samples with @mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13 14:44:25 +00:00
mrkn 1699396fe5 * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): fix the number
of figures.  Patch by Vipul A M <vipulnsward@gmail.com>.
  https://github.com/ruby/ruby/pull/323  fix GH-323

* test/bigdecimal/test_bigdecimal_util.rb: fix for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 06:37:44 +00:00
mrkn 1db209763a * ext/bigdecimal/bigdecimal.c (BigDecimal_power): use rb_dbl2big
to convert a double value to a Bignum.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 16:59:09 +00:00
zzak 2439bc9e69 * ext/bigdecimal/bigdecimal.c: Formatting for BigMath [Fixes GH-306]
Based on a patch by @eLobato.
* ext/bigdecimal/lib/bigdecimal/math.rb: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 21:00:43 +00:00
ktsj edb98f8b91 fix typos. Patch by k_takata.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 03:10:21 +00:00
akr b47138580c * lib/mkmf.rb: Add ruby/ruby.h, ruby/missing.h, ruby/intern.h,
ruby/st.h and ruby/subst.h for ruby_headers in generated Makefile.

* ext/-test-/old_thread_select/depend: Update dependencies.

* ext/-test-/wait_for_single_fd/depend: Ditto.

* ext/bigdecimal/depend: Ditto.

* ext/curses/depend: Ditto.

* ext/digest/bubblebabble/depend: Ditto.

* ext/digest/depend: Ditto.

* ext/digest/md5/depend: Ditto.

* ext/digest/rmd160/depend: Ditto.

* ext/digest/sha1/depend: Ditto.

* ext/digest/sha2/depend: Ditto.

* ext/dl/callback/depend: Ditto.

* ext/dl/depend: Ditto.

* ext/etc/depend: Ditto.

* ext/nkf/depend: Ditto.

* ext/objspace/depend: Ditto.

* ext/pty/depend: Ditto.

* ext/readline/depend: Ditto.

* ext/ripper/depend: Ditto.

* ext/sdbm/depend: Ditto.

* ext/socket/depend: Ditto.

* ext/stringio/depend: Ditto.

* ext/strscan/depend: Ditto.

* ext/syslog/depend: Ditto.

* ext/-test-/num2int/depend: Removed.

* ext/dbm/depend: Ditto.

* ext/fcntl/depend: Ditto.

* ext/gdbm/depend: Ditto.

* ext/racc/cparse/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13 00:46:29 +00:00
akr 3f9e0e43c3 * ext/bigdecimal/bigdecimal.c (VpCtoV): Initialize a local variable
even when overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-10 08:39:53 +00:00
akr fa9b5bf223 * bignum.c (rb_ll2big): Don't overflow on signed integer negation.
* ext/bigdecimal/bigdecimal.c (MUL_OVERFLOW_SIGNED_VALUE_P): New
  macro.
  (AddExponent): Don't overflow on signed integer multiplication.
  (VpCtoV): Don't overflow on signed integer arithmetic.
  (VpCtoV): Don't overflow on signed integer arithmetic.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-10 03:34:38 +00:00
hsbt 0cfc4866d4 code cleanup by @vipulnsward [GH fixes #267]
* lib/cgi/core.rb: change each to each_value
 * ext/bigdecimal/lib/bigdecimal/{jacobian,math}.rb:
   remove unused variables from bigdecimal lib



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-29 00:42:32 +00:00
naruse 20219afd83 Suppress warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-23 19:50:47 +00:00
mrkn bc43842252 * ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Use Qnil and NIL_P
instead of (VALUE)0 as a return value.

* ext/bigdecimal/bigdecimal.c (BigDecimal_div): ditto.

* ext/bigdecimal/bigdecimal.c (BigDecimal_divremain): ditto.

* ext/bigdecimal/bigdecimal.c (BigDecimal_remainder): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-23 14:30:56 +00:00
mrkn e52a4a70a9 * ext/bigdecimal/bigdecimal.c: Fix style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-22 01:38:55 +00:00
ayumin 49636da490 * ext/bigdecimal/bigdecimal.c: fixed typo. same as r39830
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-19 19:23:15 +00:00
ayumin 6f072a36c0 * ext/bigdecimal/bigdecimal.c: fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-19 19:19:46 +00:00
kazu dbec401c11 use INT2FIX(0) instead of INT2NUM(0).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-05 16:31:19 +00:00
mrkn c42cf83f26 * ext/bigdecimal/bigdecimal.gemspec: bump to 1.2.0.
[ruby-core:51777] [Bug #7761]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-19 11:50:48 +00:00
mrkn a4665e30f7 * ext/bigdecimal/bigdecimal.c (BigDecimal_to_s): use CRuby style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-14 05:42:51 +00:00
mrkn 512b987544 * ext/bigdecimal/bigdecimal.c: use `RB_TYPE_P(x, t)` instead of
`TYPE(x) == t`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-14 05:42:48 +00:00
mrkn dc2182aab8 * ext/bigdecimal/bigdecimal.c (BigDecimal_sub):
need to specify precision for converting Rational and Float.
  [ruby-dev:46544] [Bug #7404]

* ext/bigdecimal/bigdecimal.c (BigDecimal_mult): ditto.

* ext/bigdecimal/bigdecimal.c (BigDecimal_divide): ditto.

* ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): ditto.

* ext/bigdecimal/bigdecimal.c (BigDecimal_divremain): ditto.

* test/bigdecimal/test_bigdecimal.rb: add tests for the above fixes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-13 06:15:37 +00:00
mrkn 1be6a498ba * ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal):
add RB_GC_GUARD to prevent the immediate object is GCed too early.
  This patch was made by Yusuke Endoh.  [Bug #7044] [ruby-core:47632]

* test/bigdecimal/test_bigdecimal.rb: add a reproduction test for
  the issue [Bug #7044]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-07 14:42:52 +00:00
shugo 3a6dec0c5d * include/ruby/ruby.h (RB_UNUSED_VAR): new macro to suppress
warnings for unused variables.

* ext/bigdecimal/bigdecimal.c (ENTER): use RB_UNUSED_VAR() to
  suppress annoying warnings by -Wunused-but-set-variable in gcc 4.6.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-13 03:09:22 +00:00
mrkn 1fec21fe60 * ext/bigdecimal/bigdecimal.c (BigDecimal_new): stop checking string
taintness.  [Bug #5508] [ruby-core:40510]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-02 15:09:49 +00:00
zzak 50c859715d * ext/bigdecimal/bigdecimal.c:
Documentation for BigDecimal
  Based on a patch from Vincent Batts
  [ruby-core:49047] [Bug #7305]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-09 07:03:13 +00:00
mrkn a3e5a86596 * ext/bigdecimal/bigdecimal.c (BigDecimal_new),
test/bigdecimal/test_bigdecimal.rb:
  Fix exception message of BigDecimal constructor with a Float.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-01 13:04:04 +00:00
mrkn 2e6b5ece95 * ext/bigdecimal/bigdecimal.c (BigDecimal_add),
test/bigdecimal/test_bigdecimal.rb:
  need to specify precision for converting Rational and Float.
  [ruby-core:48045] [Bug #7176]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-01 13:03:53 +00:00
usa 1d1130eea1 * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): use self's sign to
determine 0.0 and Inf's sign instead of internal double value's.
  Reported by phasis68 (Heesob Park) at [ruby-core:47381] [Bug #6955]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-31 05:34:08 +00:00
nobu d7ca01a73a bigdecimal.c: check underflow
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): check underflow since
  strtod() sets errno to ERANGE at underflow too.  [ruby-core:47342]
  [Bug #6944]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-30 07:17:56 +00:00
nobu 13527efd59 bigdecimal.c: fix format specifier
* ext/bigdecimal/bigdecimal.c (BigMath_s_log): fix format specifier.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-05 15:40:56 +00:00
mrkn d3a349bbc3 * ext/bigdecimal/lib/bigdecimal/jacobian.rb,
ext/bigdecimal/lib/bigdecimal/newton.rb:
  fix documentation comments.
  Patch by alperakgun from github.com/shyouhei/ruby/pull/8

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-30 07:30:46 +00:00
mrkn ecb6bd90c0 * ext/bigdecimal/lib/bigdecimal/jacobian.rb (Jacobian#dfdxi):
fix jacobian to get stuck in an infinite loop when a solution is not
  found due to forget to increment nRetry counter.
  Patch by alperakgun from github.com/shyouhei/ruby/pull/8

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-30 07:26:51 +00:00
nobu af310963ab * ext/bigdecimal/bigdecimal.c (PUSH): to prevent VALUE from GC,
must not cast it to unsigned long, which may be shorter than
	  VALUE, and the result can be mere garbage.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-11 05:09:58 +00:00
nobu 9cc7e9d1e8 Revert r35616 "* ext/bigdecimal/bigdecimal.c: use RB_GC_GUARD. [ruby-dev:45627]"
RB_GC_GUARD() is only for variables on the machine stack, because it
forces a VALUE to be stored in a variable which should be referenced
from the GC, but does not add any reference path to the variable.
So it makes no sense for objects in heap.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-11 04:50:54 +00:00
mrkn c8b3528383 * ext/bigdecimal/bigdecimal.c: use RB_GC_GUARD. [ruby-dev:45627]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-10 18:44:25 +00:00
naruse 0fce0545b6 * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): define IDs before
they are used. [ruby-core:44900] [Bug #6406]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07 02:03:28 +00:00
drbrain da39d32f60 * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control
reaches end of non-void function" warnings.  [ruby-trunk - Bug #6066]
* re.c (name_to_backref_number):  ditto.
* object.c (rb_Float):  ditto.
* io.c (io_readpartial):  ditto.
* io.c (io_read_nonblock):  ditto.
* pack.c (rb_uv_to_utf8):  ditto.
* proc.c (rb_method_entry_arity):  ditto.
* vm_method.c (rb_f_notimplement):  ditto.
* struct.c (rb_struct_aset_id):  ditto.
* class.c (rb_scan_args):  ditto.
* process.c (rlimit_resource_type):  ditto.
* process.c (rlimit_resource_value):  ditto.
* process.c (p_uid_switch):  ditto.
* process.c (p_gid_switch):  ditto.
* ext/digest/digest.c (rb_digest_instance_update):  ditto.
* ext/digest/digest.c (rb_digest_instance_finish):  ditto.
* ext/digest/digest.c (rb_digest_instance_reset):  ditto.
* ext/digest/digest.c (rb_digest_instance_block_length):  ditto.
* ext/bigdecimal/bigdecimal.c (BigDecimalCmp):  ditto.
* ext/dl/handle.c (rb_dlhandle_close):  ditto.
* ext/tk/tcltklib.c (pending_exception_check0):  ditto.
* ext/tk/tcltklib.c (pending_exception_check1):  ditto.
* ext/tk/tcltklib.c (ip_cancel_eval_core):  ditto.
* ext/tk/tcltklib.c (lib_get_reltype_name):  ditto.
* ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core):  ditto.
* ext/tk/tkutil/tkutil.c (tk_hash_kv):  ditto.
* ext/openssl/ossl_ssl.c (ossl_ssl_session_reused):  ditto.
* ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1):  ditto.
* ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit):  ditto.
* ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve):  ditto.
* ext/fiddle/conversions.c (generic_to_value):  ditto.
* ext/socket/raddrinfo.c (rsock_io_socket_addrinfo):  ditto.
* ext/socket/socket.c (sock_s_getnameinfo):  ditto.
* ext/ripper/eventids2.c (ripper_token2eventid):  ditto.
* cont.c (return_fiber):  ditto.
* dmydln.c (dln_load):  ditto.
* vm_insnhelper.c (vm_search_normal_superclass):  ditto.
* bignum.c (big_fdiv):  ditto.
* marshal.c (r_symlink):  ditto.
* marshal.c (r_symbol):  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13 23:45:37 +00:00
naruse 697b53d8a9 * ext/bigdecimal/lib/bigdecimal/math.rb: remove description about
BigMath#log. patched by Sho Hashimoto [ruby-dev:45307] [Bug #6112]

* string.c (str_byteslice): fix typo.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-05 02:53:36 +00:00
nobu f5482e4c38 * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
can be overridden, so should not make an assumption on the type
  of results.  [ruby-core:42969][Bug #6093]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27 08:03:24 +00:00
kazu 0212af1733 * ext/bigdecimal/bigdecimal.h: add satisfy cc-mode comment.
* util.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-22 21:06:19 +00:00
nagachika c9a9036d0b ChangeLog: revert r34093. sorry, these are necessary for ruby-mode.el
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-21 15:50:15 +00:00
nagachika 4af11279c6 * ext/bigdecimal/bigdecimal.c (VpMult, VpCtoV, VpSqrt): remove assined
but unused variables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-21 15:42:41 +00:00
nagachika af845f3528 * ext/bigdecimal/bigdecimal.h: remove unused lines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-21 15:37:07 +00:00
nobu f9a4d5717c * ext/bigdecimal/bigdecimal.c (BigDecimal_s_allocate): follow
Allocation Framework.  [Bug #5775]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-21 03:35:27 +00:00
kazu 327ea26b59 * ext/bigdecimal/README: Update redmine.ruby-lang.org to bugs.ruby-lang.org
* ext/socket/ancdata.c: ditto
* test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb: ditto
* test/syck/test_yaml.rb: ditto
* doc/ChangeLog-1.9.3: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20 16:09:17 +00:00
nobu 9c00c1234d * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow
allocation framework right now.  [ruby-core:41710] [Bug #5773]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18 05:34:34 +00:00
drbrain 3a5daefe1f * ext/bigdecimal/bigdecimal.c: Document +@, -@, hash, INFINITY, Nan.
Patch by Sylvain Daubert.  [Ruby 1.9 - Feature #5622]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-07 01:58:59 +00:00
nobu d0b2816d02 * ext/bigdecimal/bigdecimal.c (VpAllocReal): reduce extra frac.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-02 06:48:10 +00:00
nobu a394c59be3 * ext/bigdecimal/bigdecimal.h (Real): suppress false warning from
clang.  [ruby-core:41418] [Bug#5693]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-01 05:43:22 +00:00
nobu 413f24d3b0 * whitespace cleanup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-04 07:19:23 +00:00