* numeric.c (fix_zero_p, fix_even_p, fix_odd_p): remove needless
functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0a607bc8f8
commit
2169bea82e
@ -1,3 +1,8 @@
|
|||||||
|
Fri Mar 18 02:17:00 2016 Kenta Murata <mrkn@mrkn.jp>
|
||||||
|
|
||||||
|
* numeric.c (fix_zero_p, fix_even_p, fix_odd_p): remove needless
|
||||||
|
functions.
|
||||||
|
|
||||||
Fri Mar 18 02:15:00 2016 Kenta Murata <mrkn@mrkn.jp>
|
Fri Mar 18 02:15:00 2016 Kenta Murata <mrkn@mrkn.jp>
|
||||||
|
|
||||||
* numeric.c (int_even_p): treat Fixnum and Bignum values directly.
|
* numeric.c (int_even_p): treat Fixnum and Bignum values directly.
|
||||||
|
49
numeric.c
49
numeric.c
@ -4031,55 +4031,6 @@ int_round(int argc, VALUE* argv, VALUE num)
|
|||||||
return int_round_0(num, ndigits);
|
return int_round_0(num, ndigits);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* call-seq:
|
|
||||||
* fix.zero? -> true or false
|
|
||||||
*
|
|
||||||
* Returns +true+ if +fix+ is zero.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
static VALUE
|
|
||||||
fix_zero_p(VALUE num)
|
|
||||||
{
|
|
||||||
if (FIX2LONG(num) == 0) {
|
|
||||||
return Qtrue;
|
|
||||||
}
|
|
||||||
return Qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* call-seq:
|
|
||||||
* fix.odd? -> true or false
|
|
||||||
*
|
|
||||||
* Returns +true+ if +fix+ is an odd number.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static VALUE
|
|
||||||
fix_odd_p(VALUE num)
|
|
||||||
{
|
|
||||||
if (num & 2) {
|
|
||||||
return Qtrue;
|
|
||||||
}
|
|
||||||
return Qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* call-seq:
|
|
||||||
* fix.even? -> true or false
|
|
||||||
*
|
|
||||||
* Returns +true+ if +fix+ is an even number.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static VALUE
|
|
||||||
fix_even_p(VALUE num)
|
|
||||||
{
|
|
||||||
if (num & 2) {
|
|
||||||
return Qfalse;
|
|
||||||
}
|
|
||||||
return Qtrue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Document-class: ZeroDivisionError
|
* Document-class: ZeroDivisionError
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user