Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!amdahl!pacbell!ditka!stb!michael From: michael@stb.UUCP (Michael) Newsgroups: comp.lang.c Subject: Re: How not to write a loop, revisited Message-ID: <10477@stb.UUCP> Date: 15 Jul 88 01:55:39 GMT References: <16276@brl-adm.ARPA> <329@accelerator.eng.ohio-state.edu> <12784@apple.Apple.COM> Reply-To: michael@stb.UUCP (Michael) Organization: STB BBS, La, Ca, Usa, +1 213 459 7231 Lines: 19 In article <12784@apple.Apple.COM> bgibbons@apple.apple.com.UUCP (Bill Gibbons) writes: [ discussion of whats representable or not] >but everyone with hardware floating-point will give you the >right result for "trunc(x/y)". ONLY if X and Y are the same sign. >I agree that exponentiation is not safe, but raising a floating-point value to >an integer (typed as integer) power is always done with repeated multiplies >(in about log2(exponent) time), and since multiplies are accurate, so is this >type of exponentiation. Hmm, when I've written exponentiation routines I do it with logs and exp(). Are you sure all vendors do it as you say? Michael : --- : Michael Gersten uunet.uu.net!denwa!stb!michael : sdcsvax!crash!gryphon!denwa!stb!michael : What would have happened if we had lost World War 2. Well, the west coast : would be owned by Japan, we would all be driving foreign cars, hmm...