diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-28 02:45:23 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-28 02:45:23 +0000 |
commit | 88d5dcc8de20a613d35827198a30010e7ed4279b (patch) | |
tree | 7e5d3b3352dbd38446002315e32d41f271167573 /ext/bigdecimal | |
parent | ba32fdd167304025106d9d79eb12388b29a4b1e6 (diff) |
* exception error messages updated. [ruby-core:04497]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 4ccba8809a..5ac81114b3 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -202,7 +202,7 @@ BigDecimal_load(VALUE self, VALUE str) /* First get max prec */ while((*pch)!=(unsigned char)'\0' && (ch=*pch++)!=(unsigned char)':') { if(!ISDIGIT(ch)) { - rb_raise(rb_eTypeError, "Load failed: invalid character in the marshaled string"); + rb_raise(rb_eTypeError, "load failed: invalid character in the marshaled string"); } m = m*10 + (unsigned long)(ch-'0'); } @@ -230,7 +230,7 @@ BigDecimal_mode(int argc, VALUE *argv, VALUE self) fo = VpGetException(); if(val==Qnil) return INT2FIX(fo); if(val!=Qfalse && val!=Qtrue) { - rb_raise(rb_eTypeError, "The second argument must be true or false."); + rb_raise(rb_eTypeError, "second argument must be true or false"); return Qnil; /* Not reached */ } if(f&VP_EXCEPTION_INFINITY) { @@ -250,13 +250,13 @@ BigDecimal_mode(int argc, VALUE *argv, VALUE self) if(val==Qnil) return INT2FIX(fo); Check_Type(val, T_FIXNUM); if(!VpIsRoundMode(FIX2INT(val))) { - rb_raise(rb_eTypeError, "Invalid rounding mode."); + rb_raise(rb_eTypeError, "invalid rounding mode"); return Qnil; } fo = VpSetRoundMode((unsigned long)FIX2INT(val)); return INT2FIX(fo); } - rb_raise(rb_eTypeError, "The first argument for BigDecimal#mode is invalid."); + rb_raise(rb_eTypeError, "first argument for BigDecimal#mode invalid"); return Qnil; } @@ -412,7 +412,7 @@ BigDecimal_to_f(VALUE self) errno = 0; d2 = pow(10.0,(double)e); if((errno == ERANGE && e>0) || (d2>1.0 && (fabs(d) > (DBL_MAX / d2)))) { - VpException(VP_EXCEPTION_OVERFLOW,"BigDecimal to Float conversion.",0); + VpException(VP_EXCEPTION_OVERFLOW,"BigDecimal to Float conversion",0); if(d>0.0) return rb_float_new(DBL_MAX); else return rb_float_new(-DBL_MAX); } @@ -940,7 +940,7 @@ BigDecimal_round(int argc, VALUE *argv, VALUE self) Check_Type(vRound, T_FIXNUM); sw = FIX2INT(vRound); if(!VpIsRoundMode(sw)) { - rb_raise(rb_eTypeError, "Invalid rounding mode."); + rb_raise(rb_eTypeError, "invalid rounding mode"); return Qnil; } break; @@ -3304,7 +3304,7 @@ VpCtoV(Real *a, char *int_chr, U_LONG ni, char *frac, U_LONG nf, char *exp_chr, es = e*((S_INT)BASE_FIG); e = e * 10 + exp_chr[i] - '0'; if(es>e*((S_INT)BASE_FIG)) { - return VpException(VP_EXCEPTION_INFINITY,"Exponent overflow",0); + return VpException(VP_EXCEPTION_INFINITY,"exponent overflow",0); } ++i; } |