зеркало из https://github.com/github/ruby.git
ChangeLog, range.c: adjust indent and style
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
69adf990e1
Коммит
e449d06f15
|
@ -27,7 +27,7 @@ Wed Jan 30 14:10:52 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
|||
Wed Jan 30 13:53:43 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||
|
||||
* lib/matrix.rb: Take conjugate for inner product
|
||||
[rubyspec:5a01ad5719f2] [ruby-dev:46101]
|
||||
[rubyspec:5a01ad5719f2] [ruby-dev:46101]
|
||||
|
||||
Wed Jan 30 13:22:05 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
|
|
16
range.c
16
range.c
|
@ -473,24 +473,27 @@ range_step(int argc, VALUE *argv, VALUE range)
|
|||
|
||||
#if SIZEOF_DOUBLE == 8 && defined(HAVE_INT64_T)
|
||||
union int64_double {
|
||||
int64_t i;
|
||||
double d;
|
||||
int64_t i;
|
||||
double d;
|
||||
};
|
||||
|
||||
static VALUE
|
||||
int64_as_double_to_num(int64_t i) {
|
||||
int64_as_double_to_num(int64_t i)
|
||||
{
|
||||
union int64_double convert;
|
||||
if (i < 0) {
|
||||
convert.i = -i;
|
||||
return DBL2NUM(-convert.d);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
convert.i = i;
|
||||
return DBL2NUM(convert.d);
|
||||
}
|
||||
}
|
||||
|
||||
static int64_t
|
||||
double_as_int64(double d) {
|
||||
double_as_int64(double d)
|
||||
{
|
||||
union int64_double convert;
|
||||
convert.d = fabs(d);
|
||||
return d < 0 ? -convert.i : convert.i;
|
||||
|
@ -498,7 +501,8 @@ double_as_int64(double d) {
|
|||
#endif
|
||||
|
||||
static int
|
||||
is_integer_p(VALUE v) {
|
||||
is_integer_p(VALUE v)
|
||||
{
|
||||
VALUE is_int = rb_check_funcall(v, id_integer_p, 0, 0);
|
||||
return RTEST(is_int) && is_int != Qundef;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче