Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!bu-cs!dartvax!ascutney.dartmouth.edu!shallit From: shallit@ascutney.dartmouth.edu Newsgroups: comp.lang.c Subject: bug in mp? Message-ID: <13612@dartvax.Dartmouth.EDU> Date: 23 May 89 19:14:20 GMT Sender: news@dartvax.Dartmouth.EDU Reply-To: shallit@ascutney.dartmouth.edu () Organization: Dartmouth College Lines: 38 I would like to hear from users of mp whether the following represents a bug or just a misunderstanding as to how mp works. When I try to compute (-10) - (-20), I get -10 instead of 10. Here's the code: ------------------------------------------------------------------------------ #include /* compile with cc test.c -lmp */ main() { MINT *a, *b, *c, *d, *e, *f; a = itom(-10); b = itom(-20); c = itom(0); msub(a,b,c); d = itom(10); e = itom(20); f = itom(0); msub(d,e,f); printf("c = "); mout (c); printf("\n f = "); mout (f); } ------------------------------------------------------------------------- Jeff Shallit Dartmouth College shallit@dartmouth.edu