mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
69adf990e1
commit
e449d06f15
2 changed files with 11 additions and 7 deletions
|
@ -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>
|
Wed Jan 30 13:53:43 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||||
|
|
||||||
* lib/matrix.rb: Take conjugate for inner product
|
* 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>
|
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)
|
#if SIZEOF_DOUBLE == 8 && defined(HAVE_INT64_T)
|
||||||
union int64_double {
|
union int64_double {
|
||||||
int64_t i;
|
int64_t i;
|
||||||
double d;
|
double d;
|
||||||
};
|
};
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
int64_as_double_to_num(int64_t i) {
|
int64_as_double_to_num(int64_t i)
|
||||||
|
{
|
||||||
union int64_double convert;
|
union int64_double convert;
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
convert.i = -i;
|
convert.i = -i;
|
||||||
return DBL2NUM(-convert.d);
|
return DBL2NUM(-convert.d);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
convert.i = i;
|
convert.i = i;
|
||||||
return DBL2NUM(convert.d);
|
return DBL2NUM(convert.d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t
|
static int64_t
|
||||||
double_as_int64(double d) {
|
double_as_int64(double d)
|
||||||
|
{
|
||||||
union int64_double convert;
|
union int64_double convert;
|
||||||
convert.d = fabs(d);
|
convert.d = fabs(d);
|
||||||
return d < 0 ? -convert.i : convert.i;
|
return d < 0 ? -convert.i : convert.i;
|
||||||
|
@ -498,7 +501,8 @@ double_as_int64(double d) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
is_integer_p(VALUE v) {
|
is_integer_p(VALUE v)
|
||||||
|
{
|
||||||
VALUE is_int = rb_check_funcall(v, id_integer_p, 0, 0);
|
VALUE is_int = rb_check_funcall(v, id_integer_p, 0, 0);
|
||||||
return RTEST(is_int) && is_int != Qundef;
|
return RTEST(is_int) && is_int != Qundef;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue