From 453366ceb90e23b70a6df738319f4aeba374075b Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 9 May 2007 03:49:18 +0000 Subject: [PATCH] * bignum.c: purged trailing spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bignum.c | 74 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/bignum.c b/bignum.c index 861e56761e..b24259e4d2 100644 --- a/bignum.c +++ b/bignum.c @@ -521,7 +521,7 @@ rb_str_to_inum(VALUE str, int base, int badcheck) s = p; } } - return rb_cstr_to_inum(s, base, badcheck); + return rb_cstr_to_inum(s, base, badcheck); } #if HAVE_LONG_LONG @@ -579,7 +579,7 @@ rb_ll2inum(LONG_LONG n) } #endif /* HAVE_LONG_LONG */ - + VALUE rb_cstr2inum(const char *str, int base) { @@ -690,10 +690,10 @@ rb_big2str(VALUE x, int base) /* * call-seq: * big.to_s(base=10) => string - * + * * Returns a string containing the representation of big radix * base (2 through 36). - * + * * 12345654321.to_s #=> "12345654321" * 12345654321.to_s(2) #=> "1011011111110110111011110000110001" * 12345654321.to_s(8) #=> "133766736061" @@ -882,10 +882,10 @@ rb_big2dbl(VALUE x) /* * call-seq: * big.to_f -> float - * + * * Converts big to a Float. If big doesn't * fit in a Float, the result is infinity. - * + * */ static VALUE @@ -897,11 +897,11 @@ rb_big_to_f(VALUE x) /* * call-seq: * big <=> numeric => -1, 0, +1 - * + * * Comparison---Returns -1, 0, or +1 depending on whether big is * less than, equal to, or greater than numeric. This is the * basis for the tests in Comparable. - * + * */ VALUE @@ -941,11 +941,11 @@ rb_big_cmp(VALUE x, VALUE y) /* * call-seq: * big == obj => true or false - * + * * Returns true only if obj has the same value * as big. Contrast this with Bignum#eql?, which * requires obj to be a Bignum. - * + * * 68719476736 == 68719476736.0 #=> true */ @@ -979,11 +979,11 @@ rb_big_eq(VALUE x, VALUE y) /* * call-seq: * big.eql?(obj) => true or false - * + * * Returns true only if obj is a * Bignum with the same value as big. Contrast this * with Bignum#==, which performs type conversions. - * + * * 68719476736.eql?(68719476736.0) #=> false */ @@ -1022,7 +1022,7 @@ rb_big_uminus(VALUE x) * length, the result acts as if it had an infinite number of one * bits to the left. In hex representations, this is displayed * as two periods to the left of the digits. - * + * * sprintf("%X", ~0x1122334455) #=> "..FEEDDCCBBAA" */ @@ -1052,7 +1052,7 @@ bigsub(VALUE x, VALUE y) BDIGIT *zds; BDIGIT_DBL_SIGNED num; long i = RBIGNUM(x)->len; - + /* if x is larger than y, swap */ if (RBIGNUM(x)->len < RBIGNUM(y)->len) { z = x; x = y; y = z; /* swap x y */ @@ -1073,11 +1073,11 @@ bigsub(VALUE x, VALUE y) z = bignew(RBIGNUM(x)->len, z==0); zds = BDIGITS(z); - for (i = 0, num = 0; i < RBIGNUM(y)->len; i++) { + for (i = 0, num = 0; i < RBIGNUM(y)->len; i++) { num += (BDIGIT_DBL_SIGNED)BDIGITS(x)[i] - BDIGITS(y)[i]; zds[i] = BIGLO(num); num = BIGDN(num); - } + } while (num && i < RBIGNUM(x)->len) { num += BDIGITS(x)[i]; zds[i++] = BIGLO(num); @@ -1087,7 +1087,7 @@ bigsub(VALUE x, VALUE y) zds[i] = BDIGITS(x)[i]; i++; } - + return z; } @@ -1212,7 +1212,7 @@ rb_big_mul0(VALUE x, VALUE y) zds = BDIGITS(z); while (j--) zds[j] = 0; for (i = 0; i < RBIGNUM(x)->len; i++) { - BDIGIT_DBL dd = BDIGITS(x)[i]; + BDIGIT_DBL dd = BDIGITS(x)[i]; if (dd == 0) continue; n = 0; for (j = 0; j < RBIGNUM(y)->len; j++) { @@ -1450,9 +1450,9 @@ rb_big_modulo(VALUE x, VALUE y) /* * call-seq: * big.remainder(numeric) => number - * + * * Returns the remainder after dividing big by numeric. - * + * * -1234567890987654321.remainder(13731) #=> -6966 * -1234567890987654321.remainder(13731.24) #=> -9906.22531493148 */ @@ -1480,9 +1480,9 @@ rb_big_remainder(VALUE x, VALUE y) /* * call-seq: * big.divmod(numeric) => array - * + * * See Numeric#divmod. - * + * */ VALUE rb_big_divmod(VALUE x, VALUE y) @@ -1532,13 +1532,13 @@ static VALUE rb_big_rshift(VALUE,VALUE); * call-seq: * big.quo(numeric) -> float * big.fdiv(numeric) -> float - * + * * Returns the floating point result of dividing big by * numeric. - * + * * -1234567890987654321.quo(13731) #=> -89910996357705.5 * -1234567890987654321.quo(13731.24) #=> -89909424858035.7 - * + * */ static VALUE @@ -1970,20 +1970,20 @@ rb_big_rshift(VALUE x, VALUE y) /* * call-seq: * big[n] -> 0, 1 - * + * * Bit Reference---Returns the nth bit in the (assumed) binary * representation of big, where big[0] is the least * significant bit. - * + * * a = 9**15 * 50.downto(0) do |n| * print a[n] * end - * + * * produces: - * + * * 000101110110100000111000011110010100111100010111001 - * + * */ static VALUE @@ -2057,9 +2057,9 @@ rb_big_coerce(VALUE x, VALUE y) /* * call-seq: * big.abs -> aBignum - * + * * Returns the absolute value of big. - * + * * -1234567890987654321.abs #=> 1234567890987654321 */ @@ -2076,10 +2076,10 @@ rb_big_abs(VALUE x) /* * call-seq: * big.size -> integer - * + * * Returns the number of bytes in the machine representation of * big. - * + * * (256**10 - 1).size #=> 12 * (256**20 - 1).size #=> 20 * (256**40 - 1).size #=> 40 @@ -2098,15 +2098,15 @@ rb_big_size(VALUE big) * Fixnum. When a calculation involving * Bignum objects returns a result that will fit in a * Fixnum, the result is automatically converted. - * + * * For the purposes of the bitwise operations and [], a * Bignum is treated as if it were an infinite-length * bitstring with 2's complement representation. - * + * * While Fixnum values are immediate, Bignum * objects are not---assignment and parameter passing work with * references to objects, not the objects themselves. - * + * */ void