Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fx_s2308
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
battle_C_5
fx_s2308
Commits
809e3a67
Commit
809e3a67
authored
4 years ago
by
Choi Jinyoung
Browse files
Options
Downloads
Patches
Plain Diff
change function name
parent
dd0e0de0
No related branches found
No related tags found
1 merge request
!3
Function2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
fx_s2308_double.c
+3
-3
3 additions, 3 deletions
fx_s2308_double.c
fx_s2308_double.h
+3
-3
3 additions, 3 deletions
fx_s2308_double.h
test.c
+3
-3
3 additions, 3 deletions
test.c
with
9 additions
and
9 deletions
fx_s2308_double.c
+
3
−
3
View file @
809e3a67
...
@@ -4,16 +4,16 @@
...
@@ -4,16 +4,16 @@
#define PI 3.1415926535897
#define PI 3.1415926535897
#define TO_RADIAN(a) (a*(PI/180))
#define TO_RADIAN(a) (a*(PI/180))
fx_s2308
fx_sine
(
fx_s2308
a
){
fx_s2308
fx_
s2308_double_
sine
(
fx_s2308
a
){
double
f_a
=
FX_TO_DOUBLE
(
a
);
double
f_a
=
FX_TO_DOUBLE
(
a
);
f_a
=
TO_RADIAN
(
f_a
);
f_a
=
TO_RADIAN
(
f_a
);
return
DOUBLE_TO_FX
(
sin
(
f_a
));
return
DOUBLE_TO_FX
(
sin
(
f_a
));
}
}
fx_s2308
fx_sqrt
(
fx_s2308
a
){
fx_s2308
fx_
s2308_double_
sqrt
(
fx_s2308
a
){
double
f_a
=
FX_TO_DOUBLE
(
a
);
double
f_a
=
FX_TO_DOUBLE
(
a
);
return
DOUBLE_TO_FX
(
sqrt
(
f_a
));
return
DOUBLE_TO_FX
(
sqrt
(
f_a
));
}
}
fx_s2308
fx_pow
(
fx_s2308
a
,
double
n
){
fx_s2308
fx_
s2308_double_
pow
(
fx_s2308
a
,
double
n
){
double
f_a
=
FX_TO_DOUBLE
(
a
);
double
f_a
=
FX_TO_DOUBLE
(
a
);
return
DOUBLE_TO_FX
(
pow
(
f_a
,
n
));
return
DOUBLE_TO_FX
(
pow
(
f_a
,
n
));
}
}
This diff is collapsed.
Click to expand it.
fx_s2308_double.h
+
3
−
3
View file @
809e3a67
...
@@ -12,7 +12,7 @@ typedef double fx_s2308;
...
@@ -12,7 +12,7 @@ typedef double fx_s2308;
#define PI 3.141592
#define PI 3.141592
#define FX_PI (INT_TO_FX(PI))
#define FX_PI (INT_TO_FX(PI))
fx_s2308
fx_sine
(
fx_s2308
a
);
fx_s2308
fx_
s2308_double_
sine
(
fx_s2308
a
);
fx_s2308
fx_sqrt
(
fx_s2308
a
);
fx_s2308
fx_
s2308_double_
sqrt
(
fx_s2308
a
);
fx_s2308
fx_pow
(
fx_s2308
a
,
double
n
);
fx_s2308
fx_
s2308_double_
pow
(
fx_s2308
a
,
double
n
);
This diff is collapsed.
Click to expand it.
test.c
+
3
−
3
View file @
809e3a67
...
@@ -10,19 +10,19 @@ int main() {
...
@@ -10,19 +10,19 @@ int main() {
printf
(
"===sine test===
\n
"
);
printf
(
"===sine test===
\n
"
);
double
a1
=
30
.
0
;
double
a1
=
30
.
0
;
fx_s2308
f_a1
=
DOUBLE_TO_FX
(
a1
);
fx_s2308
f_a1
=
DOUBLE_TO_FX
(
a1
);
fx_s2308
sine_a1
=
fx_sine
(
f_a1
);
fx_s2308
sine_a1
=
fx_
s2308_double_
sine
(
f_a1
);
printf
(
"%lf %lf %lf
\n
"
,
a1
,
f_a1
,
FX_TO_DOUBLE
(
sine_a1
));
printf
(
"%lf %lf %lf
\n
"
,
a1
,
f_a1
,
FX_TO_DOUBLE
(
sine_a1
));
printf
(
"===sqrt test===
\n
"
);
printf
(
"===sqrt test===
\n
"
);
double
a2
=
100
.
0
;
double
a2
=
100
.
0
;
fx_s2308
f_a2
=
DOUBLE_TO_FX
(
a2
);
fx_s2308
f_a2
=
DOUBLE_TO_FX
(
a2
);
fx_s2308
sqrt_a2
=
fx_sqrt
(
f_a2
);
fx_s2308
sqrt_a2
=
fx_
s2308_double_
sqrt
(
f_a2
);
printf
(
"%lf %lf %lf
\n
"
,
a2
,
f_a2
,
FX_TO_DOUBLE
(
sqrt_a2
));
printf
(
"%lf %lf %lf
\n
"
,
a2
,
f_a2
,
FX_TO_DOUBLE
(
sqrt_a2
));
printf
(
"===power test===
\n
"
);
printf
(
"===power test===
\n
"
);
double
a3
=
64
.
0
;
double
a3
=
64
.
0
;
fx_s2308
f_a3
=
DOUBLE_TO_FX
(
a3
);
fx_s2308
f_a3
=
DOUBLE_TO_FX
(
a3
);
fx_s2308
pow_a3
=
fx_pow
(
f_a3
,
2
.
0
);
fx_s2308
pow_a3
=
fx_
s2308_double_
pow
(
f_a3
,
2
.
0
);
printf
(
"%lf %lf %lf
\n
"
,
a3
,
f_a3
,
FX_TO_DOUBLE
(
pow_a3
));
printf
(
"%lf %lf %lf
\n
"
,
a3
,
f_a3
,
FX_TO_DOUBLE
(
pow_a3
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment