mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 04:55:21 +02:00
* numeric.c: purged trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ab1254448d
commit
ce6fd792ad
1 changed files with 117 additions and 117 deletions
234
numeric.c
234
numeric.c
|
@ -83,14 +83,14 @@ rb_num_zerodiv()
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.coerce(numeric) => array
|
* num.coerce(numeric) => array
|
||||||
*
|
*
|
||||||
* If <i>aNumeric</i> is the same type as <i>num</i>, returns an array
|
* If <i>aNumeric</i> is the same type as <i>num</i>, returns an array
|
||||||
* containing <i>aNumeric</i> and <i>num</i>. Otherwise, returns an
|
* containing <i>aNumeric</i> and <i>num</i>. Otherwise, returns an
|
||||||
* array with both <i>aNumeric</i> and <i>num</i> represented as
|
* array with both <i>aNumeric</i> and <i>num</i> represented as
|
||||||
* <code>Float</code> objects. This coercion mechanism is used by
|
* <code>Float</code> objects. This coercion mechanism is used by
|
||||||
* Ruby to handle mixed-type numeric operations: it is intended to
|
* Ruby to handle mixed-type numeric operations: it is intended to
|
||||||
* find a compatible common type between the two operands of the operator.
|
* find a compatible common type between the two operands of the operator.
|
||||||
*
|
*
|
||||||
* 1.coerce(2.5) #=> [2.5, 1.0]
|
* 1.coerce(2.5) #=> [2.5, 1.0]
|
||||||
* 1.2.coerce(3) #=> [3.0, 1.2]
|
* 1.2.coerce(3) #=> [3.0, 1.2]
|
||||||
* 1.coerce(2) #=> [2, 1]
|
* 1.coerce(2) #=> [2, 1]
|
||||||
|
@ -161,7 +161,7 @@ VALUE
|
||||||
rb_num_coerce_cmp(x, y)
|
rb_num_coerce_cmp(x, y)
|
||||||
VALUE x, y;
|
VALUE x, y;
|
||||||
{
|
{
|
||||||
if (do_coerce(&x, &y, Qfalse))
|
if (do_coerce(&x, &y, Qfalse))
|
||||||
return rb_funcall(x, ruby_frame->orig_func, 1, y);
|
return rb_funcall(x, ruby_frame->orig_func, 1, y);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ num_sadded(x, name)
|
||||||
rb_raise(rb_eTypeError,
|
rb_raise(rb_eTypeError,
|
||||||
"can't define singleton method \"%s\" for %s",
|
"can't define singleton method \"%s\" for %s",
|
||||||
rb_id2name(rb_to_id(name)),
|
rb_id2name(rb_to_id(name)),
|
||||||
rb_obj_classname(x));
|
rb_obj_classname(x));
|
||||||
return Qnil; /* not reached */
|
return Qnil; /* not reached */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ num_init_copy(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* +num => num
|
* +num => num
|
||||||
*
|
*
|
||||||
* Unary Plus---Returns the receiver's value.
|
* Unary Plus---Returns the receiver's value.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ num_uplus(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* -num => numeric
|
* -num => numeric
|
||||||
*
|
*
|
||||||
* Unary Minus---Returns the receiver's value, negated.
|
* Unary Minus---Returns the receiver's value, negated.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ num_uminus(num)
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.quo(numeric) => result
|
* num.quo(numeric) => result
|
||||||
* num.fdiv(numeric) => result
|
* num.fdiv(numeric) => result
|
||||||
*
|
*
|
||||||
* Equivalent to <code>Numeric#/</code>, but overridden in subclasses.
|
* Equivalent to <code>Numeric#/</code>, but overridden in subclasses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ static VALUE num_floor(VALUE num);
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.div(numeric) => integer
|
* num.div(numeric) => integer
|
||||||
*
|
*
|
||||||
* Uses <code>/</code> to perform division, then converts the result to
|
* Uses <code>/</code> to perform division, then converts the result to
|
||||||
* an integer. <code>Numeric</code> does not define the <code>/</code>
|
* an integer. <code>Numeric</code> does not define the <code>/</code>
|
||||||
* operator; this is left to subclasses.
|
* operator; this is left to subclasses.
|
||||||
|
@ -280,16 +280,16 @@ num_div(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.divmod( aNumeric ) -> anArray
|
* num.divmod( aNumeric ) -> anArray
|
||||||
*
|
*
|
||||||
* Returns an array containing the quotient and modulus obtained by
|
* Returns an array containing the quotient and modulus obtained by
|
||||||
* dividing <i>num</i> by <i>aNumeric</i>. If <code>q, r =
|
* dividing <i>num</i> by <i>aNumeric</i>. If <code>q, r =
|
||||||
* x.divmod(y)</code>, then
|
* x.divmod(y)</code>, then
|
||||||
*
|
*
|
||||||
* q = floor(float(x)/float(y))
|
* q = floor(float(x)/float(y))
|
||||||
* x = q*y + r
|
* x = q*y + r
|
||||||
*
|
*
|
||||||
* The quotient is rounded toward -infinity, as shown in the following table:
|
* The quotient is rounded toward -infinity, as shown in the following table:
|
||||||
*
|
*
|
||||||
* a | b | a.divmod(b) | a/b | a.modulo(b) | a.remainder(b)
|
* a | b | a.divmod(b) | a/b | a.modulo(b) | a.remainder(b)
|
||||||
* ------+-----+---------------+---------+-------------+---------------
|
* ------+-----+---------------+---------+-------------+---------------
|
||||||
* 13 | 4 | 3, 1 | 3 | 1 | 1
|
* 13 | 4 | 3, 1 | 3 | 1 | 1
|
||||||
|
@ -327,7 +327,7 @@ num_divmod(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.modulo(numeric) => result
|
* num.modulo(numeric) => result
|
||||||
*
|
*
|
||||||
* Equivalent to
|
* Equivalent to
|
||||||
* <i>num</i>.<code>divmod(</code><i>aNumeric</i><code>)[1]</code>.
|
* <i>num</i>.<code>divmod(</code><i>aNumeric</i><code>)[1]</code>.
|
||||||
*/
|
*/
|
||||||
|
@ -342,7 +342,7 @@ num_modulo(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.remainder(numeric) => result
|
* num.remainder(numeric) => result
|
||||||
*
|
*
|
||||||
* If <i>num</i> and <i>numeric</i> have different signs, returns
|
* If <i>num</i> and <i>numeric</i> have different signs, returns
|
||||||
* <em>mod</em>-<i>numeric</i>; otherwise, returns <em>mod</em>. In
|
* <em>mod</em>-<i>numeric</i>; otherwise, returns <em>mod</em>. In
|
||||||
* both cases <em>mod</em> is the value
|
* both cases <em>mod</em> is the value
|
||||||
|
@ -370,7 +370,7 @@ num_remainder(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.integer? -> true or false
|
* num.integer? -> true or false
|
||||||
*
|
*
|
||||||
* Returns <code>true</code> if <i>num</i> is an <code>Integer</code>
|
* Returns <code>true</code> if <i>num</i> is an <code>Integer</code>
|
||||||
* (including <code>Fixnum</code> and <code>Bignum</code>).
|
* (including <code>Fixnum</code> and <code>Bignum</code>).
|
||||||
*/
|
*/
|
||||||
|
@ -385,9 +385,9 @@ num_int_p(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.abs => num or numeric
|
* num.abs => num or numeric
|
||||||
*
|
*
|
||||||
* Returns the absolute value of <i>num</i>.
|
* Returns the absolute value of <i>num</i>.
|
||||||
*
|
*
|
||||||
* 12.abs #=> 12
|
* 12.abs #=> 12
|
||||||
* (-34.56).abs #=> 34.56
|
* (-34.56).abs #=> 34.56
|
||||||
* -34.56.abs #=> 34.56
|
* -34.56.abs #=> 34.56
|
||||||
|
@ -407,7 +407,7 @@ num_abs(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.zero? => true or false
|
* num.zero? => true or false
|
||||||
*
|
*
|
||||||
* Returns <code>true</code> if <i>num</i> has a zero value.
|
* Returns <code>true</code> if <i>num</i> has a zero value.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -425,10 +425,10 @@ num_zero_p(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.nonzero? => num or nil
|
* num.nonzero? => num or nil
|
||||||
*
|
*
|
||||||
* Returns <i>num</i> if <i>num</i> is not zero, <code>nil</code>
|
* Returns <i>num</i> if <i>num</i> is not zero, <code>nil</code>
|
||||||
* otherwise. This behavior is useful when chaining comparisons:
|
* otherwise. This behavior is useful when chaining comparisons:
|
||||||
*
|
*
|
||||||
* a = %w( z Bb bB bb BB a aA Aa AA A )
|
* a = %w( z Bb bB bb BB a aA Aa AA A )
|
||||||
* b = a.sort {|a,b| (a.downcase <=> b.downcase).nonzero? || a <=> b }
|
* b = a.sort {|a,b| (a.downcase <=> b.downcase).nonzero? || a <=> b }
|
||||||
* b #=> ["A", "a", "AA", "Aa", "aA", "BB", "Bb", "bB", "bb", "z"]
|
* b #=> ["A", "a", "AA", "Aa", "aA", "BB", "Bb", "bB", "bb", "z"]
|
||||||
|
@ -447,7 +447,7 @@ num_nonzero_p(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.to_int => integer
|
* num.to_int => integer
|
||||||
*
|
*
|
||||||
* Invokes the child class's <code>to_i</code> method to convert
|
* Invokes the child class's <code>to_i</code> method to convert
|
||||||
* <i>num</i> to an integer.
|
* <i>num</i> to an integer.
|
||||||
*/
|
*/
|
||||||
|
@ -461,7 +461,7 @@ num_to_int(num)
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
*
|
*
|
||||||
* Document-class: Float
|
* Document-class: Float
|
||||||
*
|
*
|
||||||
* <code>Float</code> objects represent real numbers using the native
|
* <code>Float</code> objects represent real numbers using the native
|
||||||
|
@ -482,7 +482,7 @@ rb_float_new(d)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.to_s => string
|
* flt.to_s => string
|
||||||
*
|
*
|
||||||
* Returns a string containing a representation of self. As well as a
|
* Returns a string containing a representation of self. As well as a
|
||||||
* fixed or exponential form of the number, the call may return
|
* fixed or exponential form of the number, the call may return
|
||||||
* ``<code>NaN</code>'', ``<code>Infinity</code>'', and
|
* ``<code>NaN</code>'', ``<code>Infinity</code>'', and
|
||||||
|
@ -677,9 +677,9 @@ flodivmod(x, y, divp, modp)
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt % other => float
|
* flt % other => float
|
||||||
* flt.modulo(other) => float
|
* flt.modulo(other) => float
|
||||||
*
|
*
|
||||||
* Return the modulo after division of <code>flt</code> by <code>other</code>.
|
* Return the modulo after division of <code>flt</code> by <code>other</code>.
|
||||||
*
|
*
|
||||||
* 6543.21.modulo(137) #=> 104.21
|
* 6543.21.modulo(137) #=> 104.21
|
||||||
* 6543.21.modulo(137.24) #=> 92.9299999999996
|
* 6543.21.modulo(137.24) #=> 92.9299999999996
|
||||||
*/
|
*/
|
||||||
|
@ -710,7 +710,7 @@ flo_mod(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.divmod(numeric) => array
|
* flt.divmod(numeric) => array
|
||||||
*
|
*
|
||||||
* See <code>Numeric#divmod</code>.
|
* See <code>Numeric#divmod</code>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -753,7 +753,7 @@ flo_divmod(x, y)
|
||||||
*
|
*
|
||||||
* Raises <code>float</code> the <code>other</code> power.
|
* Raises <code>float</code> the <code>other</code> power.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
flo_pow(x, y)
|
flo_pow(x, y)
|
||||||
VALUE x, y;
|
VALUE x, y;
|
||||||
|
@ -773,10 +773,10 @@ flo_pow(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.eql?(numeric) => true or false
|
* num.eql?(numeric) => true or false
|
||||||
*
|
*
|
||||||
* Returns <code>true</code> if <i>num</i> and <i>numeric</i> are the
|
* Returns <code>true</code> if <i>num</i> and <i>numeric</i> are the
|
||||||
* same type and have equal values.
|
* same type and have equal values.
|
||||||
*
|
*
|
||||||
* 1 == 1.0 #=> true
|
* 1 == 1.0 #=> true
|
||||||
* 1.eql?(1.0) #=> false
|
* 1.eql?(1.0) #=> false
|
||||||
* (1.0).eql?(1.0) #=> true
|
* (1.0).eql?(1.0) #=> true
|
||||||
|
@ -794,7 +794,7 @@ num_eql(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num <=> other -> 0 or nil
|
* num <=> other -> 0 or nil
|
||||||
*
|
*
|
||||||
* Returns zero if <i>num</i> equals <i>other</i>, <code>nil</code>
|
* Returns zero if <i>num</i> equals <i>other</i>, <code>nil</code>
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
|
@ -818,13 +818,13 @@ num_equal(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt == obj => true or false
|
* flt == obj => true or false
|
||||||
*
|
*
|
||||||
* Returns <code>true</code> only if <i>obj</i> has the same value
|
* Returns <code>true</code> only if <i>obj</i> has the same value
|
||||||
* as <i>flt</i>. Contrast this with <code>Float#eql?</code>, which
|
* as <i>flt</i>. Contrast this with <code>Float#eql?</code>, which
|
||||||
* requires <i>obj</i> to be a <code>Float</code>.
|
* requires <i>obj</i> to be a <code>Float</code>.
|
||||||
*
|
*
|
||||||
* 1.0 == 1 #=> true
|
* 1.0 == 1 #=> true
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -891,7 +891,7 @@ rb_dbl_cmp(a, b)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt <=> numeric => -1, 0, +1
|
* flt <=> numeric => -1, 0, +1
|
||||||
*
|
*
|
||||||
* Returns -1, 0, or +1 depending on whether <i>flt</i> is less than,
|
* Returns -1, 0, or +1 depending on whether <i>flt</i> is less than,
|
||||||
* equal to, or greater than <i>numeric</i>. This is the basis for the
|
* equal to, or greater than <i>numeric</i>. This is the basis for the
|
||||||
* tests in <code>Comparable</code>.
|
* tests in <code>Comparable</code>.
|
||||||
|
@ -962,7 +962,7 @@ flo_gt(x, y)
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt >= other => true or false
|
* flt >= other => true or false
|
||||||
*
|
*
|
||||||
* <code>true</code> if <code>flt</code> is greater than
|
* <code>true</code> if <code>flt</code> is greater than
|
||||||
* or equal to <code>other</code>.
|
* or equal to <code>other</code>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1068,11 +1068,11 @@ flo_le(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.eql?(obj) => true or false
|
* flt.eql?(obj) => true or false
|
||||||
*
|
*
|
||||||
* Returns <code>true</code> only if <i>obj</i> is a
|
* Returns <code>true</code> only if <i>obj</i> is a
|
||||||
* <code>Float</code> with the same value as <i>flt</i>. Contrast this
|
* <code>Float</code> with the same value as <i>flt</i>. Contrast this
|
||||||
* with <code>Float#==</code>, which performs type conversions.
|
* with <code>Float#==</code>, which performs type conversions.
|
||||||
*
|
*
|
||||||
* 1.0.eql?(1) #=> false
|
* 1.0.eql?(1) #=> false
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1107,12 +1107,12 @@ flo_to_f(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.abs => float
|
* flt.abs => float
|
||||||
*
|
*
|
||||||
* Returns the absolute value of <i>flt</i>.
|
* Returns the absolute value of <i>flt</i>.
|
||||||
*
|
*
|
||||||
* (-34.56).abs #=> 34.56
|
* (-34.56).abs #=> 34.56
|
||||||
* -34.56.abs #=> 34.56
|
* -34.56.abs #=> 34.56
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -1126,9 +1126,9 @@ flo_abs(flt)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.zero? -> true or false
|
* flt.zero? -> true or false
|
||||||
*
|
*
|
||||||
* Returns <code>true</code> if <i>flt</i> is 0.0.
|
* Returns <code>true</code> if <i>flt</i> is 0.0.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -1144,10 +1144,10 @@ flo_zero_p(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.nan? -> true or false
|
* flt.nan? -> true or false
|
||||||
*
|
*
|
||||||
* Returns <code>true</code> if <i>flt</i> is an invalid IEEE floating
|
* Returns <code>true</code> if <i>flt</i> is an invalid IEEE floating
|
||||||
* point number.
|
* point number.
|
||||||
*
|
*
|
||||||
* a = -1.0 #=> -1.0
|
* a = -1.0 #=> -1.0
|
||||||
* a.nan? #=> false
|
* a.nan? #=> false
|
||||||
* a = 0.0/0.0 #=> NaN
|
* a = 0.0/0.0 #=> NaN
|
||||||
|
@ -1157,7 +1157,7 @@ flo_zero_p(num)
|
||||||
static VALUE
|
static VALUE
|
||||||
flo_is_nan_p(num)
|
flo_is_nan_p(num)
|
||||||
VALUE num;
|
VALUE num;
|
||||||
{
|
{
|
||||||
double value = RFLOAT(num)->value;
|
double value = RFLOAT(num)->value;
|
||||||
|
|
||||||
return isnan(value) ? Qtrue : Qfalse;
|
return isnan(value) ? Qtrue : Qfalse;
|
||||||
|
@ -1166,10 +1166,10 @@ flo_is_nan_p(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.infinite? -> nil, -1, +1
|
* flt.infinite? -> nil, -1, +1
|
||||||
*
|
*
|
||||||
* Returns <code>nil</code>, -1, or +1 depending on whether <i>flt</i>
|
* Returns <code>nil</code>, -1, or +1 depending on whether <i>flt</i>
|
||||||
* is finite, -infinity, or +infinity.
|
* is finite, -infinity, or +infinity.
|
||||||
*
|
*
|
||||||
* (0.0).infinite? #=> nil
|
* (0.0).infinite? #=> nil
|
||||||
* (-1.0/0.0).infinite? #=> -1
|
* (-1.0/0.0).infinite? #=> -1
|
||||||
* (+1.0/0.0).infinite? #=> 1
|
* (+1.0/0.0).infinite? #=> 1
|
||||||
|
@ -1178,7 +1178,7 @@ flo_is_nan_p(num)
|
||||||
static VALUE
|
static VALUE
|
||||||
flo_is_infinite_p(num)
|
flo_is_infinite_p(num)
|
||||||
VALUE num;
|
VALUE num;
|
||||||
{
|
{
|
||||||
double value = RFLOAT(num)->value;
|
double value = RFLOAT(num)->value;
|
||||||
|
|
||||||
if (isinf(value)) {
|
if (isinf(value)) {
|
||||||
|
@ -1191,17 +1191,17 @@ flo_is_infinite_p(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.finite? -> true or false
|
* flt.finite? -> true or false
|
||||||
*
|
*
|
||||||
* Returns <code>true</code> if <i>flt</i> is a valid IEEE floating
|
* Returns <code>true</code> if <i>flt</i> is a valid IEEE floating
|
||||||
* point number (it is not infinite, and <code>nan?</code> is
|
* point number (it is not infinite, and <code>nan?</code> is
|
||||||
* <code>false</code>).
|
* <code>false</code>).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
flo_is_finite_p(num)
|
flo_is_finite_p(num)
|
||||||
VALUE num;
|
VALUE num;
|
||||||
{
|
{
|
||||||
double value = RFLOAT(num)->value;
|
double value = RFLOAT(num)->value;
|
||||||
|
|
||||||
#if HAVE_FINITE
|
#if HAVE_FINITE
|
||||||
|
@ -1218,9 +1218,9 @@ flo_is_finite_p(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.floor => integer
|
* flt.floor => integer
|
||||||
*
|
*
|
||||||
* Returns the largest integer less than or equal to <i>flt</i>.
|
* Returns the largest integer less than or equal to <i>flt</i>.
|
||||||
*
|
*
|
||||||
* 1.2.floor #=> 1
|
* 1.2.floor #=> 1
|
||||||
* 2.0.floor #=> 2
|
* 2.0.floor #=> 2
|
||||||
* (-1.2).floor #=> -2
|
* (-1.2).floor #=> -2
|
||||||
|
@ -1244,10 +1244,10 @@ flo_floor(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.ceil => integer
|
* flt.ceil => integer
|
||||||
*
|
*
|
||||||
* Returns the smallest <code>Integer</code> greater than or equal to
|
* Returns the smallest <code>Integer</code> greater than or equal to
|
||||||
* <i>flt</i>.
|
* <i>flt</i>.
|
||||||
*
|
*
|
||||||
* 1.2.ceil #=> 2
|
* 1.2.ceil #=> 2
|
||||||
* 2.0.ceil #=> 2
|
* 2.0.ceil #=> 2
|
||||||
* (-1.2).ceil #=> -1
|
* (-1.2).ceil #=> -1
|
||||||
|
@ -1271,18 +1271,18 @@ flo_ceil(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* flt.round => integer
|
* flt.round => integer
|
||||||
*
|
*
|
||||||
* Rounds <i>flt</i> to the nearest integer. Equivalent to:
|
* Rounds <i>flt</i> to the nearest integer. Equivalent to:
|
||||||
*
|
*
|
||||||
* def round
|
* def round
|
||||||
* return (self+0.5).floor if self > 0.0
|
* return (self+0.5).floor if self > 0.0
|
||||||
* return (self-0.5).ceil if self < 0.0
|
* return (self-0.5).ceil if self < 0.0
|
||||||
* return 0
|
* return 0
|
||||||
* end
|
* end
|
||||||
*
|
*
|
||||||
* 1.5.round #=> 2
|
* 1.5.round #=> 2
|
||||||
* (-1.5).round #=> -2
|
* (-1.5).round #=> -2
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -1307,7 +1307,7 @@ flo_round(num)
|
||||||
* flt.to_i => integer
|
* flt.to_i => integer
|
||||||
* flt.to_int => integer
|
* flt.to_int => integer
|
||||||
* flt.truncate => integer
|
* flt.truncate => integer
|
||||||
*
|
*
|
||||||
* Returns <i>flt</i> truncated to an <code>Integer</code>.
|
* Returns <i>flt</i> truncated to an <code>Integer</code>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1332,11 +1332,11 @@ flo_truncate(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.floor => integer
|
* num.floor => integer
|
||||||
*
|
*
|
||||||
* Returns the largest integer less than or equal to <i>num</i>.
|
* Returns the largest integer less than or equal to <i>num</i>.
|
||||||
* <code>Numeric</code> implements this by converting <i>anInteger</i>
|
* <code>Numeric</code> implements this by converting <i>anInteger</i>
|
||||||
* to a <code>Float</code> and invoking <code>Float#floor</code>.
|
* to a <code>Float</code> and invoking <code>Float#floor</code>.
|
||||||
*
|
*
|
||||||
* 1.floor #=> 1
|
* 1.floor #=> 1
|
||||||
* (-1).floor #=> -1
|
* (-1).floor #=> -1
|
||||||
*/
|
*/
|
||||||
|
@ -1352,12 +1352,12 @@ num_floor(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.ceil => integer
|
* num.ceil => integer
|
||||||
*
|
*
|
||||||
* Returns the smallest <code>Integer</code> greater than or equal to
|
* Returns the smallest <code>Integer</code> greater than or equal to
|
||||||
* <i>num</i>. Class <code>Numeric</code> achieves this by converting
|
* <i>num</i>. Class <code>Numeric</code> achieves this by converting
|
||||||
* itself to a <code>Float</code> then invoking
|
* itself to a <code>Float</code> then invoking
|
||||||
* <code>Float#ceil</code>.
|
* <code>Float#ceil</code>.
|
||||||
*
|
*
|
||||||
* 1.ceil #=> 1
|
* 1.ceil #=> 1
|
||||||
* 1.2.ceil #=> 2
|
* 1.2.ceil #=> 2
|
||||||
* (-1.2).ceil #=> -1
|
* (-1.2).ceil #=> -1
|
||||||
|
@ -1374,7 +1374,7 @@ num_ceil(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.round => integer
|
* num.round => integer
|
||||||
*
|
*
|
||||||
* Rounds <i>num</i> to the nearest integer. <code>Numeric</code>
|
* Rounds <i>num</i> to the nearest integer. <code>Numeric</code>
|
||||||
* implements this by converting itself to a
|
* implements this by converting itself to a
|
||||||
* <code>Float</code> and invoking <code>Float#round</code>.
|
* <code>Float</code> and invoking <code>Float#round</code>.
|
||||||
|
@ -1390,7 +1390,7 @@ num_round(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.truncate => integer
|
* num.truncate => integer
|
||||||
*
|
*
|
||||||
* Returns <i>num</i> truncated to an integer. <code>Numeric</code>
|
* Returns <i>num</i> truncated to an integer. <code>Numeric</code>
|
||||||
* implements this by converting its value to a float and invoking
|
* implements this by converting its value to a float and invoking
|
||||||
* <code>Float#truncate</code>.
|
* <code>Float#truncate</code>.
|
||||||
|
@ -1407,7 +1407,7 @@ num_truncate(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* num.step(limit, step ) {|i| block } => num
|
* num.step(limit, step ) {|i| block } => num
|
||||||
*
|
*
|
||||||
* Invokes <em>block</em> with the sequence of numbers starting at
|
* Invokes <em>block</em> with the sequence of numbers starting at
|
||||||
* <i>num</i>, incremented by <i>step</i> on each call. The loop
|
* <i>num</i>, incremented by <i>step</i> on each call. The loop
|
||||||
* finishes when the value to be passed to the block is greater than
|
* finishes when the value to be passed to the block is greater than
|
||||||
|
@ -1421,12 +1421,12 @@ num_truncate(num)
|
||||||
* <code>></code> operator to compare the counter against
|
* <code>></code> operator to compare the counter against
|
||||||
* <i>limit</i>, and increments itself using the <code>+</code>
|
* <i>limit</i>, and increments itself using the <code>+</code>
|
||||||
* operator.
|
* operator.
|
||||||
*
|
*
|
||||||
* 1.step(10, 2) { |i| print i, " " }
|
* 1.step(10, 2) { |i| print i, " " }
|
||||||
* Math::E.step(Math::PI, 0.2) { |f| print f, " " }
|
* Math::E.step(Math::PI, 0.2) { |f| print f, " " }
|
||||||
*
|
*
|
||||||
* <em>produces:</em>
|
* <em>produces:</em>
|
||||||
*
|
*
|
||||||
* 1 3 5 7 9
|
* 1 3 5 7 9
|
||||||
* 2.71828182845905 2.91828182845905 3.11828182845905
|
* 2.71828182845905 2.91828182845905 3.11828182845905
|
||||||
*/
|
*/
|
||||||
|
@ -1722,7 +1722,7 @@ rb_num2ull(val)
|
||||||
*
|
*
|
||||||
* <code>Integer</code> is the basis for the two concrete classes that
|
* <code>Integer</code> is the basis for the two concrete classes that
|
||||||
* hold whole numbers, <code>Bignum</code> and <code>Fixnum</code>.
|
* hold whole numbers, <code>Bignum</code> and <code>Fixnum</code>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -1749,7 +1749,7 @@ int_to_i(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* int.integer? -> true
|
* int.integer? -> true
|
||||||
*
|
*
|
||||||
* Always returns <code>true</code>.
|
* Always returns <code>true</code>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1764,9 +1764,9 @@ int_int_p(num)
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* int.next => integer
|
* int.next => integer
|
||||||
* int.succ => integer
|
* int.succ => integer
|
||||||
*
|
*
|
||||||
* Returns the <code>Integer</code> equal to <i>int</i> + 1.
|
* Returns the <code>Integer</code> equal to <i>int</i> + 1.
|
||||||
*
|
*
|
||||||
* 1.next #=> 2
|
* 1.next #=> 2
|
||||||
* (-1).next #=> 0
|
* (-1).next #=> 0
|
||||||
*/
|
*/
|
||||||
|
@ -1785,10 +1785,10 @@ int_succ(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* int.chr => string
|
* int.chr => string
|
||||||
*
|
*
|
||||||
* Returns a string containing the ASCII character represented by the
|
* Returns a string containing the ASCII character represented by the
|
||||||
* receiver's value.
|
* receiver's value.
|
||||||
*
|
*
|
||||||
* 65.chr #=> "A"
|
* 65.chr #=> "A"
|
||||||
* ?a.chr #=> "a"
|
* ?a.chr #=> "a"
|
||||||
* 230.chr #=> "\346"
|
* 230.chr #=> "\346"
|
||||||
|
@ -1808,14 +1808,14 @@ int_chr(num)
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
*
|
*
|
||||||
* Document-class: Fixnum
|
* Document-class: Fixnum
|
||||||
*
|
*
|
||||||
* A <code>Fixnum</code> holds <code>Integer</code> values that can be
|
* A <code>Fixnum</code> holds <code>Integer</code> values that can be
|
||||||
* represented in a native machine word (minus 1 bit). If any operation
|
* represented in a native machine word (minus 1 bit). If any operation
|
||||||
* on a <code>Fixnum</code> exceeds this range, the value is
|
* on a <code>Fixnum</code> exceeds this range, the value is
|
||||||
* automatically converted to a <code>Bignum</code>.
|
* automatically converted to a <code>Bignum</code>.
|
||||||
*
|
*
|
||||||
* <code>Fixnum</code> objects have immediate value. This means that
|
* <code>Fixnum</code> objects have immediate value. This means that
|
||||||
* when they are assigned or passed as parameters, the actual object is
|
* when they are assigned or passed as parameters, the actual object is
|
||||||
* passed, rather than a reference to that object. Assignment does not
|
* passed, rather than a reference to that object. Assignment does not
|
||||||
|
@ -1935,10 +1935,10 @@ rb_fix2str(x, base)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix.to_s( base=10 ) -> aString
|
* fix.to_s( base=10 ) -> aString
|
||||||
*
|
*
|
||||||
* Returns a string containing the representation of <i>fix</i> radix
|
* Returns a string containing the representation of <i>fix</i> radix
|
||||||
* <i>base</i> (between 2 and 36).
|
* <i>base</i> (between 2 and 36).
|
||||||
*
|
*
|
||||||
* 12345.to_s #=> "12345"
|
* 12345.to_s #=> "12345"
|
||||||
* 12345.to_s(2) #=> "11000000111001"
|
* 12345.to_s(2) #=> "11000000111001"
|
||||||
* 12345.to_s(8) #=> "30071"
|
* 12345.to_s(8) #=> "30071"
|
||||||
|
@ -1968,7 +1968,7 @@ fix_to_s(argc, argv, x)
|
||||||
* fix + numeric => numeric_result
|
* fix + numeric => numeric_result
|
||||||
*
|
*
|
||||||
* Performs addition: the class of the resulting object depends on
|
* Performs addition: the class of the resulting object depends on
|
||||||
* the class of <code>numeric</code> and on the magnitude of the
|
* the class of <code>numeric</code> and on the magnitude of the
|
||||||
* result.
|
* result.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1998,7 +1998,7 @@ fix_plus(x, y)
|
||||||
* fix - numeric => numeric_result
|
* fix - numeric => numeric_result
|
||||||
*
|
*
|
||||||
* Performs subtraction: the class of the resulting object depends on
|
* Performs subtraction: the class of the resulting object depends on
|
||||||
* the class of <code>numeric</code> and on the magnitude of the
|
* the class of <code>numeric</code> and on the magnitude of the
|
||||||
* result.
|
* result.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2028,7 +2028,7 @@ fix_minus(x, y)
|
||||||
* fix * numeric => numeric_result
|
* fix * numeric => numeric_result
|
||||||
*
|
*
|
||||||
* Performs multiplication: the class of the resulting object depends on
|
* Performs multiplication: the class of the resulting object depends on
|
||||||
* the class of <code>numeric</code> and on the magnitude of the
|
* the class of <code>numeric</code> and on the magnitude of the
|
||||||
* result.
|
* result.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2095,13 +2095,13 @@ fixdivmod(x, y, divp, modp)
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix.quo(numeric) => float
|
* fix.quo(numeric) => float
|
||||||
* fix.fdiv(numeric) => float
|
* fix.fdiv(numeric) => float
|
||||||
*
|
*
|
||||||
* Returns the floating point result of dividing <i>fix</i> by
|
* Returns the floating point result of dividing <i>fix</i> by
|
||||||
* <i>numeric</i>.
|
* <i>numeric</i>.
|
||||||
*
|
*
|
||||||
* 654321.quo(13731) #=> 47.6528293642124
|
* 654321.quo(13731) #=> 47.6528293642124
|
||||||
* 654321.quo(13731.24) #=> 47.6519964693647
|
* 654321.quo(13731.24) #=> 47.6519964693647
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -2120,7 +2120,7 @@ fix_quo(x, y)
|
||||||
* fix.div(numeric) => numeric_result
|
* fix.div(numeric) => numeric_result
|
||||||
*
|
*
|
||||||
* Performs division: the class of the resulting object depends on
|
* Performs division: the class of the resulting object depends on
|
||||||
* the class of <code>numeric</code> and on the magnitude of the
|
* the class of <code>numeric</code> and on the magnitude of the
|
||||||
* result.
|
* result.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2162,7 +2162,7 @@ fix_mod(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix.divmod(numeric) => array
|
* fix.divmod(numeric) => array
|
||||||
*
|
*
|
||||||
* See <code>Numeric#divmod</code>.
|
* See <code>Numeric#divmod</code>.
|
||||||
*/
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -2270,7 +2270,7 @@ fix_equal(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix <=> numeric => -1, 0, +1
|
* fix <=> numeric => -1, 0, +1
|
||||||
*
|
*
|
||||||
* Comparison---Returns -1, 0, or +1 depending on whether <i>fix</i> is
|
* Comparison---Returns -1, 0, or +1 depending on whether <i>fix</i> is
|
||||||
* less than, equal to, or greater than <i>numeric</i>. This is the
|
* less than, equal to, or greater than <i>numeric</i>. This is the
|
||||||
* basis for the tests in <code>Comparable</code>.
|
* basis for the tests in <code>Comparable</code>.
|
||||||
|
@ -2517,16 +2517,16 @@ fix_rshift(x, y)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix[n] => 0, 1
|
* fix[n] => 0, 1
|
||||||
*
|
*
|
||||||
* Bit Reference---Returns the <em>n</em>th bit in the binary
|
* Bit Reference---Returns the <em>n</em>th bit in the binary
|
||||||
* representation of <i>fix</i>, where <i>fix</i>[0] is the least
|
* representation of <i>fix</i>, where <i>fix</i>[0] is the least
|
||||||
* significant bit.
|
* significant bit.
|
||||||
*
|
*
|
||||||
* a = 0b11001100101010
|
* a = 0b11001100101010
|
||||||
* 30.downto(0) do |n| print a[n] end
|
* 30.downto(0) do |n| print a[n] end
|
||||||
*
|
*
|
||||||
* <em>produces:</em>
|
* <em>produces:</em>
|
||||||
*
|
*
|
||||||
* 0000000000000000011001100101010
|
* 0000000000000000011001100101010
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2560,9 +2560,9 @@ fix_aref(fix, idx)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix.to_f -> float
|
* fix.to_f -> float
|
||||||
*
|
*
|
||||||
* Converts <i>fix</i> to a <code>Float</code>.
|
* Converts <i>fix</i> to a <code>Float</code>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -2579,12 +2579,12 @@ fix_to_f(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix.abs -> aFixnum
|
* fix.abs -> aFixnum
|
||||||
*
|
*
|
||||||
* Returns the absolute value of <i>fix</i>.
|
* Returns the absolute value of <i>fix</i>.
|
||||||
*
|
*
|
||||||
* -12345.abs #=> 12345
|
* -12345.abs #=> 12345
|
||||||
* 12345.abs #=> 12345
|
* 12345.abs #=> 12345
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -2601,13 +2601,13 @@ fix_abs(fix)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix.id2name -> string or nil
|
* fix.id2name -> string or nil
|
||||||
*
|
*
|
||||||
* Returns the name of the object whose symbol id is <i>fix</i>. If
|
* Returns the name of the object whose symbol id is <i>fix</i>. If
|
||||||
* there is no symbol in the symbol table with this value, returns
|
* there is no symbol in the symbol table with this value, returns
|
||||||
* <code>nil</code>. <code>id2name</code> has nothing to do with the
|
* <code>nil</code>. <code>id2name</code> has nothing to do with the
|
||||||
* <code>Object.id</code> method. See also <code>Fixnum#to_sym</code>,
|
* <code>Object.id</code> method. See also <code>Fixnum#to_sym</code>,
|
||||||
* <code>String#intern</code>, and class <code>Symbol</code>.
|
* <code>String#intern</code>, and class <code>Symbol</code>.
|
||||||
*
|
*
|
||||||
* symbol = :@inst_var #=> :@inst_var
|
* symbol = :@inst_var #=> :@inst_var
|
||||||
* id = symbol.to_i #=> 9818
|
* id = symbol.to_i #=> 9818
|
||||||
* id.id2name #=> "@inst_var"
|
* id.id2name #=> "@inst_var"
|
||||||
|
@ -2626,10 +2626,10 @@ fix_id2name(fix)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix.to_sym -> aSymbol
|
* fix.to_sym -> aSymbol
|
||||||
*
|
*
|
||||||
* Returns the symbol whose integer value is <i>fix</i>. See also
|
* Returns the symbol whose integer value is <i>fix</i>. See also
|
||||||
* <code>Fixnum#id2name</code>.
|
* <code>Fixnum#id2name</code>.
|
||||||
*
|
*
|
||||||
* fred = :fred.to_i
|
* fred = :fred.to_i
|
||||||
* fred.id2name #=> "fred"
|
* fred.id2name #=> "fred"
|
||||||
* fred.to_sym #=> :fred
|
* fred.to_sym #=> :fred
|
||||||
|
@ -2651,10 +2651,10 @@ fix_to_sym(fix)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix.size -> fixnum
|
* fix.size -> fixnum
|
||||||
*
|
*
|
||||||
* Returns the number of <em>bytes</em> in the machine representation
|
* Returns the number of <em>bytes</em> in the machine representation
|
||||||
* of a <code>Fixnum</code>.
|
* of a <code>Fixnum</code>.
|
||||||
*
|
*
|
||||||
* 1.size #=> 4
|
* 1.size #=> 4
|
||||||
* -1.size #=> 4
|
* -1.size #=> 4
|
||||||
* 2147483647.size #=> 4
|
* 2147483647.size #=> 4
|
||||||
|
@ -2670,14 +2670,14 @@ fix_size(fix)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* int.upto(limit) {|i| block } => int
|
* int.upto(limit) {|i| block } => int
|
||||||
*
|
*
|
||||||
* Iterates <em>block</em>, passing in integer values from <i>int</i>
|
* Iterates <em>block</em>, passing in integer values from <i>int</i>
|
||||||
* up to and including <i>limit</i>.
|
* up to and including <i>limit</i>.
|
||||||
*
|
*
|
||||||
* 5.upto(10) { |i| print i, " " }
|
* 5.upto(10) { |i| print i, " " }
|
||||||
*
|
*
|
||||||
* <em>produces:</em>
|
* <em>produces:</em>
|
||||||
*
|
*
|
||||||
* 5 6 7 8 9 10
|
* 5 6 7 8 9 10
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2708,15 +2708,15 @@ int_upto(from, to)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* int.downto(limit) {|i| block } => int
|
* int.downto(limit) {|i| block } => int
|
||||||
*
|
*
|
||||||
* Iterates <em>block</em>, passing decreasing values from <i>int</i>
|
* Iterates <em>block</em>, passing decreasing values from <i>int</i>
|
||||||
* down to and including <i>limit</i>.
|
* down to and including <i>limit</i>.
|
||||||
*
|
*
|
||||||
* 5.downto(1) { |n| print n, ".. " }
|
* 5.downto(1) { |n| print n, ".. " }
|
||||||
* print " Liftoff!\n"
|
* print " Liftoff!\n"
|
||||||
*
|
*
|
||||||
* <em>produces:</em>
|
* <em>produces:</em>
|
||||||
*
|
*
|
||||||
* 5.. 4.. 3.. 2.. 1.. Liftoff!
|
* 5.. 4.. 3.. 2.. 1.. Liftoff!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2747,16 +2747,16 @@ int_downto(from, to)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* int.times {|i| block } => int
|
* int.times {|i| block } => int
|
||||||
*
|
*
|
||||||
* Iterates block <i>int</i> times, passing in values from zero to
|
* Iterates block <i>int</i> times, passing in values from zero to
|
||||||
* <i>int</i> - 1.
|
* <i>int</i> - 1.
|
||||||
*
|
*
|
||||||
* 5.times do |i|
|
* 5.times do |i|
|
||||||
* print i, " "
|
* print i, " "
|
||||||
* end
|
* end
|
||||||
*
|
*
|
||||||
* <em>produces:</em>
|
* <em>produces:</em>
|
||||||
*
|
*
|
||||||
* 0 1 2 3 4
|
* 0 1 2 3 4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2787,9 +2787,9 @@ int_dotimes(num)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* fix.zero? => true or false
|
* fix.zero? => true or false
|
||||||
*
|
*
|
||||||
* Returns <code>true</code> if <i>fix</i> is zero.
|
* Returns <code>true</code> if <i>fix</i> is zero.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue