repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Sync usage with man page.
[netbsd-mini2440.git]
/
sys
/
arch
/
pmax
/
test
/
fp1.c
blob
87db1453ca705079511bb13ff25eb6c7ce5016d9
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
union
{
5
unsigned
w
;
6
float
f
;
7
}
uf
;
8
9
union
{
10
unsigned
w
[
2
];
11
double
d
;
12
}
ud
;
13
14
/*
15
* Read test vectors from file and test the fp emulation by
16
* comparing it with the hardware.
17
*/
18
main
(
argc
,
argv
)
19
int
argc
;
20
char
**
argv
;
21
{
22
char
buf
[
1024
];
23
24
while
(
fgets
(
buf
,
sizeof
(
buf
),
stdin
) !=
NULL
) {
25
ud
.
d
=
atof
(
buf
);
26
uf
.
f
=
ud
.
d
;
27
printf
(
"'%s' (%x,%x) (%x)
\n
"
,
buf
,
ud
.
w
[
1
],
ud
.
w
[
0
],
uf
.
w
);
28
}
29
exit
(
0
);
30
}