Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pcc022
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
이소현
pcc022
Commits
5f00212e
Commit
5f00212e
authored
3 years ago
by
이소현
Browse files
Options
Downloads
Patches
Plain Diff
lec09
parent
d54baf28
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
lec09/test.c
+45
-0
45 additions, 0 deletions
lec09/test.c
lec09/ulimit.txt
+16
-0
16 additions, 0 deletions
lec09/ulimit.txt
with
61 additions
and
0 deletions
lec09/test.c
0 → 100644
+
45
−
0
View file @
5f00212e
#include
<stdio.h>
#include
<math.h>
// #### #### #### #### . #### #### #### #### - 32bit
// Sbit 15bit . 16bit
#define FX_Q_NUM 16
#define FX_2_MINUS_16 1.52587890625e-05F
#define FX_2_PLUS_16 (1<<16)
#define FX_S_15_16 11516 // 1:singed 15 16
#define FX_SYSTEM FX_S_15_16
typedef
int
fixed32
;
fixed32
fromFloat
(
float
fa
)
{
return
(
fixed32
)
(
fa
*
FX_2_PLUS_16
);
}
float
toFloat
(
fixed32
xa
)
{
return
((
float
)
(
xa
))
*
FX_2_MINUS_16
;
}
fixed32
fxAdd
(
fixed32
a
,
fixed32
b
)
{
return
fromFloat
((
toFloat
(
a
)
+
toFloat
(
b
)));
}
fixed32
fxAdd2
(
fixed32
a
,
fixed32
b
)
{
return
a
+
b
;
}
int
main
()
{
int
i
=
0
;
int
ia
,
ib
,
ic
,
ic2
;
float
fa
;
fscanf
(
stdin
,
"%d %d"
,
&
ia
,
&
ib
);
for
(
i
=
0
;
i
<
64
*
256
*
256
*
256
;
i
+=
(
256
*
256
))
{
ic
=
fxAdd
(
i
,
i
);
ic2
=
fxAdd2
(
i
,
i
);
fprintf
(
stdout
,
"%f + %f : %f, %f diff=%d
\n
"
,
toFloat
(
i
),
toFloat
(
i
),
toFloat
(
ic
),
toFloat
(
ic2
),
ic
-
ic2
);
}
fprintf
(
stdout
,
"%d + %d : %d
\n
"
,
ia
,
ib
,
ic
);
}
This diff is collapsed.
Click to expand it.
lec09/ulimit.txt
0 → 100644
+
16
−
0
View file @
5f00212e
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 256271
max locked memory (kbytes, -l) 65536
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 256271
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
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