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
de67c321
Commit
de67c321
authored
May 01, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove round(3) to avoid -std=c99
parent
4fd26048
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
src/numeric.c
src/numeric.c
+18
-1
No files found.
src/numeric.c
View file @
de67c321
...
@@ -102,13 +102,30 @@ const unsigned char mrb_nan[] = "\x7f\xc0\x00\x00";
...
@@ -102,13 +102,30 @@ const unsigned char mrb_nan[] = "\x7f\xc0\x00\x00";
#endif
#endif
#ifdef MRB_USE_FLOAT
#ifdef MRB_USE_FLOAT
#define round(f) roundf(f)
#define floor(f) floorf(f)
#define floor(f) floorf(f)
#define ceil(f) ceilf(f)
#define ceil(f) ceilf(f)
#define floor(f) floorf(f)
#define floor(f) floorf(f)
#define fmod(x,y) fmodf(x,y)
#define fmod(x,y) fmodf(x,y)
#endif
#endif
static
mrb_float
mrb_round
(
mrb_float
x
)
{
mrb_float
f
;
if
(
x
>
0
.
0
)
{
f
=
floor
(
x
);
x
=
f
+
(
x
-
f
>=
0
.
5
);
}
else
if
(
x
<
0
.
0
)
{
f
=
ceil
(
x
);
x
=
f
-
(
f
-
x
>=
0
.
5
);
}
return
x
;
}
#define round(x) mrb_round(x)
void
mrb_cmperr
(
mrb_state
*
mrb
,
mrb_value
x
,
mrb_value
y
);
void
mrb_cmperr
(
mrb_state
*
mrb
,
mrb_value
x
,
mrb_value
y
);
void
void
...
...
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