1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/bigdecimal/bigdecimal.c (VpCtoV): big number should result

to infinite.  backported from 1.9.

* ext/bigdecimal/bigdecimal.c (VpIsRoundMode): rounding mode
  condition check updated.  backported from 1.9.

* ext/bigdecimal/bigdecimal.c (VpPower): should handle NaN and
  Inf.  backported from 1.9.

* ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): divmod should
  raise ZeroDivisionError.  backported from 1.9.

* ext/bigdecimal/bigdecimal.c (BigDecimal_mode): should check
  exception for VP_EXCEPTION_UNDERFLOW and VP_EXCEPTION_ZERODIVIDE.
  backported from 1.9.

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

* ext/bigdecimal/bigdecimal.h (VP_EXCEPTION_ZERODIVIDE): new error
  code.  backported from 1.9.

* ext/bigdecimal/bigdecimal.c (BigDecimal_div2, BigDecimal_round,
  BigDecimal_truncate, BigDecimal_floor, BigDecimal_ceil): eagerly convert
  bigdecimal to integer.  backported from 1.9.

* ext/bigdecimal/bigdecimal.c (VpMult): free internal Real.
  backported from 1.9.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-06-11 06:06:01 +00:00
parent 3bb5d07486
commit 1e7898d76a
4 changed files with 784 additions and 20 deletions

View file

@ -45,7 +45,7 @@ extern "C" {
#define VP_EXCEPTION_NaN ((unsigned short)0x0002)
#define VP_EXCEPTION_UNDERFLOW ((unsigned short)0x0004)
#define VP_EXCEPTION_OVERFLOW ((unsigned short)0x0001) /* 0x0008) */
#define VP_EXCEPTION_ZERODIVIDE ((unsigned short)0x0001) /* 0x0010) */
#define VP_EXCEPTION_ZERODIVIDE ((unsigned short)0x0010)
/* Following 2 exceptions cann't controlled by user */
#define VP_EXCEPTION_OP ((unsigned short)0x0020)