Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: # to the nth power Message-ID: <4247@goanna.cs.rmit.oz.au> Date: 12 Nov 90 07:31:43 GMT References: <1990Nov10.224939.23622@dirtydog.ima.isc.com> <14427@smoke.brl.mil> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 19 In article <14427@smoke.brl.mil>, gwyn@smoke.brl.mil (Doug Gwyn) writes: : In article <4239@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: : >Does anyone know why C hasn't got a round() function and why ANSI : >failed to add one? : : Because it is trivial to roll your own: : #define Round( d ) floor( (d) + 0.5 ) /* requires */ : and because there was no established existing practice (e.g. the library : Base Document did not specify such a function). I'm afraid it's not that trivial. That doesn't provide the preferred round-to-even-when-there-is-a-tie. It is a _pain_ that the function nint() isn't portable. The Base Document didn't specify fsetpos() either, but that didn't stop ANSI filling in a nasty gap. What's the NCEWG up to? Are they likely to address this? -- The problem about real life is that moving one's knight to QB3 may always be replied to with a lob across the net. --Alasdair Macintyre.