Path: utzoo!mnetor!uunet!mcvax!diku!keld From: keld@diku.dk (Keld J|rn Simonsen) Newsgroups: comp.arch Subject: Re: Re: More than 32 bits needed where? Message-ID: <3671@diku.dk> Date: 16 Feb 88 16:53:20 GMT References: <235@unicom.UUCP> <28200089@ccvaxa> <3104@watcgl.waterloo.edu> <4340@ames.arpa> <1333@vaxb.calgary.UUCP> <41350@sun.uucp> <9495@steinmetz.steinmetz.UUCP> <4679@ames.arpa> Organization: DIKU, U of Copenhagen, DK Lines: 24 About dollar and other currencies: you need to represent them in the smallest unit to be sure of having a correct representation, and you need integer or BCD arithmetic to preserve precision. So for USA you have to do your operations in cents. And if we leave one bit for the sign you can have a max of 2**31 cents represented in a 32 bit word. 2 G cents = 20 million dollar. Not much. In other currencies the smallest unit may be worth 0.1 cents or less. Danish kroner (DKK) or French francs (FFR) are amongst these currencies. Italian lire is even less. So here you are only able to have a maximum worth about 2 million US dollar. There is a problem with C that long ints are usually not more than 32 bits, even if the hardware is capable of doing 64 bits adds and subtracts. This I foresee to cause severe problems for C-based accounting software! Comments? Other uses of more that 32 bits is for social security numbers. They are 10 digits here in Denmark, and that needs 34 bits. Other countries may have even longer numbers. I think 64 bit integers are needed! And has to be supported by languages as C! Keld Simonsen, U of Copenhagen keld@diku.dk uunet!diku!keld