Merge from vendor branch DIFFUTILS:
[dragonfly.git] / contrib / bc / Test / BUG.bc
1 /* <--- bug.bc ---><--- bug.bc ---><--- bug.bc ---><--- bug.bc ---> */
2
3 /*
4  *  See the file "signum" for a description and reference for this
5  *  program.  
6  *
7  *  THIS BUG IS *NOT* IN GNU BC!!!
8  *
9  */
10
11 obase=16
12 ibase=16
13 x=1A8F5C99605AE52       /* dividend                     */
14 y=BB0B404               /* divisor                      */
15 q=245A07AD              /* (correct) quotient           */
16 r=147EB9E               /* (correct) remainder          */
17 "Base 16
18 "
19 "x    = "; x            /* output numbers just to be sure... */
20 "y    = "; y
21 "quo  = "; q
22 "rem  = "; r
23 "x/y  = "; x/y          /* watch this result! */
24 "x%y  = "; x%y          /* watch this result! */
25 "y*q+r= "; y*q+r        /* check quotient & remainder   */
26 /*
27  * Do the same thing in base 10:
28  */
29 "
30 Base 10
31 "
32 ibase=A
33 obase=10
34 "x    = "; x            /* output numbers just to be sure... */
35 "y    = "; y
36 "q    = "; q
37 "r    = "; r
38 "x/y  = "; x/y          /* watch this result! */
39 "x%y  = "; x%y          /* watch this result! */
40 "y*q+r= "; y*q+r        /* check quotient & remainder   */