Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 exptools; site ihlpa.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!ihlpa!rjh From: rjh@ihlpa.UUCP (Herber) Newsgroups: net.lang.c Subject: Re: Float:16 Message-ID: <821@ihlpa.UUCP> Date: Fri, 4-Oct-85 16:11:28 EDT Article-I.D.: ihlpa.821 Posted: Fri Oct 4 16:11:28 1985 Date-Received: Sat, 5-Oct-85 07:49:16 EDT References: <1869@brl-tgr.ARPA> Organization: AT&T Bell Laboratories Lines: 30 > > > > Then you can define > > > > > > > > float foo:16; > > > > > > > > if you really think you can do something useful with 16-bit floats. Someone > > > > must use them for something... > > > > > > Just such a construct is used in the accounting software in many UNIX System > > > kernels. It seems to suffice for the application. > > > > Great, a violation of the C language spec in the kernel. > > Not really. I haven't axually seen it, but here's my theory: > There must be a union of short[2] & float somewhere in the (which?) > kernel. The magic numbers are computed in float and the short[0] is > written out to a file, the lower mantissa bits being deemed worthless. > Not a violation, just (nonportable) bit fiddling. > > jim cottrell@nbs > */ > ------ The "float:16" construct is contructed in a machine-independent fashion in the accounting routines by shifting bits and or-ing. The values are always positive; therefore there is no mantissa sign bit. And, since the values are integers, the exponent field is not offset. The values are using to accumulate values like CPU-clockticks used by a process against a uid. The "floating-point" (I would call it "scaled integer") format is used to support a large dynamic range. Randolph J. Herber