Project

General

Profile

Feature #5622 ยป 0001-adding-documentation-for-BigDecimal-INFINITY-BigDeci.patch

sdaubert (Sylvain Daubert), 11/12/2011 11:23 PM

View differences:

ext/bigdecimal/bigdecimal.c
return obj;
}
/*
* call-seq: hash
*
* Creates and returns a hash from sign, fractional part and exponent.
*/
static VALUE
BigDecimal_hash(VALUE self)
{
......
return obj;
}
/*
* call-seq: +@
*
* Return self.
*
* e.g.
* b = +a # b == a
*/
static VALUE
BigDecimal_uplus(VALUE self)
{
......
return BigDecimalCmp(self, r, 'G');
}
/*
* call-seq: -@
*
* Return the opposite of self.
*
* e.g.
* b = -a # b == a * -1
*/
static VALUE
BigDecimal_neg(VALUE self)
{
......
rb_define_const(rb_cBigDecimal, "SIGN_NEGATIVE_INFINITE",INT2FIX(VP_SIGN_NEGATIVE_INFINITE));
arg = rb_str_new2("+Infinity");
/* Positive infinity value. */
rb_define_const(rb_cBigDecimal, "INFINITY", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
arg = rb_str_new2("NaN");
/* 'Not a Number' value. */
rb_define_const(rb_cBigDecimal, "NAN", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
    (1-1/1)