Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.lang.c,comp.unix.xenix Subject: Re: Are the floating point routines on my machine broken? Message-ID: <7456@utzoo.UUCP> Date: Tue, 30-Dec-86 19:28:41 EST Article-I.D.: utzoo.7456 Posted: Tue Dec 30 19:28:41 1986 Date-Received: Tue, 30-Dec-86 19:28:41 EST References: <442@catnip.UUCP> Organization: U of Toronto Zoology Lines: 12 > ... Is roundup considered acceptable > behavior for floating point routines? Or am I somehow misinterpreting > the problem? The precise details of rounding are very machine-dependent and you are not entitled to make assumptions about them. Don't forget that there is rounding in the additions as well as in the representation of "0.2". It is a grave mistake to use floating-point arithmetic to control a loop which has to iterate an exact number of times. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,decvax,pyramid}!utzoo!henry