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
17cb50f8
Unverified
Commit
17cb50f8
authored
Jan 02, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid `int64_t` on 32 bit platforms.
parent
757902c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
mrbgems/mruby-rational/src/rational.c
mrbgems/mruby-rational/src/rational.c
+3
-1
No files found.
mrbgems/mruby-rational/src/rational.c
View file @
17cb50f8
...
...
@@ -102,8 +102,10 @@ rational_new(mrb_state *mrb, mrb_int numerator, mrb_int denominator)
*/
#ifdef MRB_INT32
typedef
float
rat_float
;
typedef
int32_t
rat_int
;
#else
typedef
double
rat_float
;
typedef
int64_t
rat_int
;
#endif
void
mrb_check_num_exact
(
mrb_state
*
mrb
,
mrb_float
num
);
...
...
@@ -116,7 +118,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0)
/* a: continued fraction coefficients. */
mrb_int
a
,
h
[
3
]
=
{
0
,
1
,
0
},
k
[
3
]
=
{
1
,
0
,
0
};
mrb_int
x
,
d
;
int64_
t
n
=
1
;
rat_in
t
n
=
1
;
int
i
,
neg
=
0
;
mrb_check_num_exact
(
mrb
,
f0
);
...
...
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