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
36b79619
Commit
36b79619
authored
4 years ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
adding test.c
parent
0c34be4b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
a.out
+0
-0
0 additions, 0 deletions
a.out
test.c
+123
-76
123 additions, 76 deletions
test.c
with
123 additions
and
76 deletions
a.out
0 → 100644
+
0
−
0
View file @
36b79619
File added
This diff is collapsed.
Click to expand it.
test.c
+
123
−
76
View file @
36b79619
#define _CRT_SECURE_NO_WARNINGS
#include
"fx_s4716_double.h"
#include
"fx_s4716_longlong.h"
extern
void
fx_to_double
(
fx_s4716
a
);
extern
void
double_to_fx
(
double
a
);
...
...
@@ -20,6 +21,17 @@ int main()
int
option
;
int
quit
=
0
;
printf
(
"This is program to test fixed point arithmetic
\n
"
);
printf
(
" OPTION
\n
"
);
printf
(
"1. double
\n
"
);
printf
(
"2. longlong
\n
"
);
printf
(
"0. quit
\n\n
"
);
printf
(
"Type option : "
);
fflush
(
stdout
);
scanf
(
"%d"
,
&
option
);
if
(
option
==
0
)
return
0
;
else
if
(
option
==
1
)
{
printf
(
" OPTION
\n
"
);
printf
(
"0. add
\n
"
);
printf
(
"1. subtract
\n
"
);
...
...
@@ -96,9 +108,44 @@ int main()
break
;
}
if
(
quit
==
1
)
{
printf
(
"Quit the program"
);
printf
(
"Quit the program
\n
"
);
break
;
}
}
}
else
if
(
option
==
2
)
{
// temp before making c file
long
long
t
,
tt
,
ttt
;
printf
(
" OPTION
\n
"
);
printf
(
"1. multiply
\n
"
);
printf
(
"2. division
\n
"
);
printf
(
"0. quit
\n\n
"
);
while
(
1
)
{
printf
(
"Type option : "
);
fflush
(
stdout
);
scanf
(
"%d"
,
&
option
);
switch
(
option
)
{
case
0
:
return
0
;
case
1
:
printf
(
"Input two number : "
);
fflush
(
stdout
);
scanf
(
"%lld %lld"
,
&
a
,
&
b
);
t
=
fx_s4716_longlong_mul
(
a
,
b
);
tt
=
fx_s4716_longlong_mul1
(
a
,
b
);
ttt
=
fx_s4716_longlong_mul2
(
a
,
b
);
printf
(
"%lld %lld %lld
\n
"
,
t
,
tt
,
ttt
);
break
;
case
2
:
printf
(
"Input two number : "
);
fflush
(
stdout
);
scanf
(
"%lld %lld"
,
&
a
,
&
b
);
t
=
fx_s4716_longlong_div
(
a
,
b
);
tt
=
fx_s4716_longlong_div1
(
a
,
b
);
ttt
=
fx_s4716_longlong_div2
(
a
,
b
);
printf
(
"%lld %lld %lld
\n
"
,
t
,
tt
,
ttt
);
break
;
}
}
}
}
\ No newline at end of file
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