Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fx_s4716
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
battle_C_6
fx_s4716
Commits
fad6082b
Commit
fad6082b
authored
4 years ago
by
Sangbaek Lee
Browse files
Options
Downloads
Patches
Plain Diff
test fx
parent
98c2dbee
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
fx_s4716_double.c
+4
-0
4 additions, 0 deletions
fx_s4716_double.c
fx_s4716_double.h
+1
-0
1 addition, 0 deletions
fx_s4716_double.h
fx_s4716_double.o
+0
-0
0 additions, 0 deletions
fx_s4716_double.o
test.c
+7
-1
7 additions, 1 deletion
test.c
test.o
+0
-0
0 additions, 0 deletions
test.o
with
12 additions
and
1 deletion
fx_s4716_double.c
+
4
−
0
View file @
fad6082b
...
...
@@ -40,3 +40,7 @@ void fx_pow(fx_s4716 a){
double
power
=
FX_S4716_DOUBLE_POW
(
a
);
printf
(
"fx pow : %.16lf
\n
"
,
power
);
}
void
fx_sine
(
fx_s4716
a
){
double
sine
=
FX_S4716_DOUBLE_SINE
(
a
);
printf
(
"fx sine : %.16lf
\n
"
,
sine
);
}
This diff is collapsed.
Click to expand it.
fx_s4716_double.h
+
1
−
0
View file @
fad6082b
...
...
@@ -33,3 +33,4 @@ typedef long long fx_s4716;
#define FX_INV_PI (DOUBLE_TO_FX(1/(M_PI)))
#define FX_S4716_DOUBLE_SQRT(a) ((sqrt(a))/(F_POWER_2_8))
#define FX_S4716_DOUBLE_POW(a) ((pow((double)a, 2.0))*(F_POWER_2_16))
#define FX_S4716_DOUBLE_SINE(a) (sin(a))
This diff is collapsed.
Click to expand it.
fx_s4716_double.o
+
0
−
0
View file @
fad6082b
No preview for this file type
This diff is collapsed.
Click to expand it.
test.c
+
7
−
1
View file @
fad6082b
...
...
@@ -11,6 +11,7 @@ extern void fx_pi();
extern
void
fx_inv_pi
();
extern
void
fx_sqrt
(
fx_s4716
a
);
extern
void
fx_pow
(
fx_s4716
a
);
extern
void
fx_sine
(
fx_s4716
a
);
int
main
()
{
...
...
@@ -29,7 +30,8 @@ int main()
printf
(
"7. print inverse PI
\n
"
);
printf
(
"8. fix to double
\n
"
);
printf
(
"9. double to fix
\n
"
);
printf
(
"10. quit
\n\n
"
);
printf
(
"10 get sine value
\n
"
);
printf
(
"11. quit
\n\n
"
);
printf
(
"Type option : "
);
fflush
(
stdout
);
...
...
@@ -82,6 +84,10 @@ int main()
scanf
(
"%lf"
,
&
c
);
double_to_fx
(
c
);
break
;
case
10
:
printf
(
"Input one number : "
);
fflush
(
stdout
);
scanf
(
"%lld"
,
&
a
);
fx_sine
(
a
);
default:
break
;
}
...
...
This diff is collapsed.
Click to expand it.
test.o
+
0
−
0
View file @
fad6082b
No preview for this file type
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