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
295 295
    return obj;
296 296
}
297 297

  
298
/*
299
 * call-seq: hash
300
 *
301
 * Creates and returns a hash from sign, fractional part and exponent.
302
 */
298 303
static VALUE
299 304
BigDecimal_hash(VALUE self)
300 305
{
......
767 772
    return obj;
768 773
}
769 774

  
775
/*
776
 * call-seq: +@
777
 *
778
 * Return self.
779
 *
780
 * e.g.
781
 *   b = +a  # b == a
782
 */
770 783
static VALUE
771 784
BigDecimal_uplus(VALUE self)
772 785
{
......
1033 1046
    return BigDecimalCmp(self, r, 'G');
1034 1047
}
1035 1048

  
1049
/*
1050
 * call-seq: -@
1051
 *
1052
 * Return the opposite of self.
1053
 *
1054
 * e.g.
1055
 *   b = -a # b == a * -1
1056
 */
1036 1057
static VALUE
1037 1058
BigDecimal_neg(VALUE self)
1038 1059
{
......
2912 2933
    rb_define_const(rb_cBigDecimal, "SIGN_NEGATIVE_INFINITE",INT2FIX(VP_SIGN_NEGATIVE_INFINITE));
2913 2934

  
2914 2935
    arg = rb_str_new2("+Infinity");
2936
    /* Positive infinity value. */
2915 2937
    rb_define_const(rb_cBigDecimal, "INFINITY", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
2916 2938
    arg = rb_str_new2("NaN");
2939
    /* 'Not a Number' value. */
2917 2940
    rb_define_const(rb_cBigDecimal, "NAN", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
2918 2941

  
2919 2942