diff options
author | andreas <andreas@FreeBSD.org> | 1998-04-29 21:53:01 +0000 |
---|---|---|
committer | andreas <andreas@FreeBSD.org> | 1998-04-29 21:53:01 +0000 |
commit | 0ec6169bea8adb8ddbf8f9ce363f6e1803f88621 (patch) | |
tree | 1529c15b522fa7bd199b5491bc88817aefc9b779 /contrib/bc/Test/BUG.bc | |
download | FreeBSD-src-0ec6169bea8adb8ddbf8f9ce363f6e1803f88621.zip FreeBSD-src-0ec6169bea8adb8ddbf8f9ce363f6e1803f88621.tar.gz |
Import GNU bc 1.04
PR: 4183
Diffstat (limited to 'contrib/bc/Test/BUG.bc')
-rw-r--r-- | contrib/bc/Test/BUG.bc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/contrib/bc/Test/BUG.bc b/contrib/bc/Test/BUG.bc new file mode 100644 index 0000000..254eefe --- /dev/null +++ b/contrib/bc/Test/BUG.bc @@ -0,0 +1,40 @@ +/* <--- bug.bc ---><--- bug.bc ---><--- bug.bc ---><--- bug.bc ---> */ + +/* + * See the file "signum" for a description and reference for this + * program. + * + * THIS BUG IS *NOT* IN GNU BC!!! + * + */ + +obase=16 +ibase=16 +x=1A8F5C99605AE52 /* dividend */ +y=BB0B404 /* divisor */ +q=245A07AD /* (correct) quotient */ +r=147EB9E /* (correct) remainder */ +"Base 16 +" +"x = "; x /* output numbers just to be sure... */ +"y = "; y +"quo = "; q +"rem = "; r +"x/y = "; x/y /* watch this result! */ +"x%y = "; x%y /* watch this result! */ +"y*q+r= "; y*q+r /* check quotient & remainder */ +/* + * Do the same thing in base 10: + */ +" +Base 10 +" +ibase=A +obase=10 +"x = "; x /* output numbers just to be sure... */ +"y = "; y +"q = "; q +"r = "; r +"x/y = "; x/y /* watch this result! */ +"x%y = "; x%y /* watch this result! */ +"y*q+r= "; y*q+r /* check quotient & remainder */ |