Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!princeton!phoenix!jjbaker From: jjbaker@phoenix.UUCP Newsgroups: comp.lang.c,comp.sources.wanted Subject: Re: Any-length numbers Message-ID: <149@phoenix.PRINCETON.EDU> Date: Sat, 21-Mar-87 17:26:48 EST Article-I.D.: phoenix.149 Posted: Sat Mar 21 17:26:48 1987 Date-Received: Sun, 22-Mar-87 17:59:19 EST References: <139@uop.UUCP> Organization: Princeton Univ. Computing and Information Technology Lines: 23 Xref: utgpu comp.lang.c:1292 comp.sources.wanted:769 Summary: ditto In article <139@uop.UUCP>, exodus@uop.UUCP (Greg Onufer) writes: > **************************************************** > Wanted: C BCD routines for any-length numbers!!!! > Does anybody have short & sweet routines for > adding, subtracting, multiplying, and dividing packed > (or unpacked) BCD digits stored in C unsigned char > arrays? [Packed: 2 BCD digits per byte] > Any help would be greatly appreciated. Thanx in advance... > > Send responses through mail or Snailmail only... Me too! Me too! I'm writing a simulator of an IBM 650 computer, which used 10-decimal-digit words. I used VAX assembler for the arithmetic, but want to port to PC and others, so I need C routines. Actually, my numbers are stored in ASCII form, and the CVTSP instruction converts to packed BCD for the arithmetic machine instructions. Thanbo (...!princeton!phoenix!jjbaker) (6056626@pucc.BITNET)