projects
/
nestedvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d05879b
)
misc test changes
author
brian
<brian@brianweb.net>
Thu, 27 May 2004 06:59:02 +0000
(23:59 -0700)
committer
brian
<brian@brianweb.net>
Thu, 27 May 2004 06:59:02 +0000
(23:59 -0700)
darcs-hash:
20040527065902
-24bed-
126e178e30ca7d36a869c498a9eb6237813f3c76
.gz
src/tests/Simple.c
patch
|
blob
|
history
src/tests/Test.c
patch
|
blob
|
history
diff --git
a/src/tests/Simple.c
b/src/tests/Simple.c
index
02f0700
..
c943264
100644
(file)
--- a/
src/tests/Simple.c
+++ b/
src/tests/Simple.c
@@
-1,23
+1,10
@@
+#include <math.h>
-int precision = 7;
-long long r;
-
-#define HOST_BITS_PER_WIDE_INT 64
-#define HOST_WIDE_INT long long
-
-long long x = 123;
-
-int dec(long long x){
- return x - 1;
-}
+double d = -1.23;
int _start() {
- //long long r = (((HOST_WIDE_INT) 1 << (precision - 1)) - 1);
- //long long r = ((HOST_WIDE_INT) 1 << (precision)) - 1;
- long long r = x - 1;
-
- //r = dec(x);
- r >>= 32;
-
- return r;
+ int n;
+ d = fabs(d);
+ n = (int)(d*100);
+ return n;;
}
diff --git
a/src/tests/Test.c
b/src/tests/Test.c
index
659254b
..
b7b35b5
100644
(file)
--- a/
src/tests/Test.c
+++ b/
src/tests/Test.c
@@
-210,8
+210,8
@@
int main(int argc, char **argv) {
{
double d = -2.34;
- //d = abs(d);
- printf("abs(-2.24) = %g\n",d);
+ d = fabs(d);
+ printf("fabs(-2.24) = %g\n",d);
}