Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
55251cb1
Commit
55251cb1
authored
Apr 26, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2130 from suzukaze/refactor-numeric.c
Refactor numeric.c
parents
b1b3ee45
68ce209f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
src/numeric.c
src/numeric.c
+4
-13
No files found.
src/numeric.c
View file @
55251cb1
...
...
@@ -494,11 +494,8 @@ static mrb_value
flo_finite_p
(
mrb_state
*
mrb
,
mrb_value
num
)
{
mrb_float
value
=
mrb_float
(
num
);
mrb_bool
finite_p
;
finite_p
=
!
(
isinf
(
value
)
||
isnan
(
value
));
return
mrb_bool_value
(
finite_p
);
return
mrb_bool_value
(
!
(
isinf
(
value
)
||
isnan
(
value
)));
}
/* 15.2.9.3.10 */
...
...
@@ -918,13 +915,11 @@ static mrb_value
fix_and
(
mrb_state
*
mrb
,
mrb_value
x
)
{
mrb_value
y
;
mrb_int
val
;
mrb_get_args
(
mrb
,
"o"
,
&
y
);
y
=
bit_coerce
(
mrb
,
y
);
val
=
mrb_fixnum
(
x
)
&
mrb_fixnum
(
y
);
return
mrb_fixnum_value
(
val
);
return
mrb_fixnum_value
(
mrb_fixnum
(
x
)
&
mrb_fixnum
(
y
));
}
/* 15.2.8.3.10 */
...
...
@@ -939,13 +934,11 @@ static mrb_value
fix_or
(
mrb_state
*
mrb
,
mrb_value
x
)
{
mrb_value
y
;
mrb_int
val
;
mrb_get_args
(
mrb
,
"o"
,
&
y
);
y
=
bit_coerce
(
mrb
,
y
);
val
=
mrb_fixnum
(
x
)
|
mrb_fixnum
(
y
);
return
mrb_fixnum_value
(
val
);
return
mrb_fixnum_value
(
mrb_fixnum
(
x
)
|
mrb_fixnum
(
y
));
}
/* 15.2.8.3.11 */
...
...
@@ -960,13 +953,11 @@ static mrb_value
fix_xor
(
mrb_state
*
mrb
,
mrb_value
x
)
{
mrb_value
y
;
mrb_int
val
;
mrb_get_args
(
mrb
,
"o"
,
&
y
);
y
=
bit_coerce
(
mrb
,
y
);
val
=
mrb_fixnum
(
x
)
^
mrb_fixnum
(
y
);
return
mrb_fixnum_value
(
val
);
return
mrb_fixnum_value
(
mrb_fixnum
(
x
)
^
mrb_fixnum
(
y
));
}
#define NUMERIC_SHIFT_WIDTH_MAX (MRB_INT_BIT-1)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment