From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6a8952cbe009f3ed X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII X-Received: by 10.180.83.2 with SMTP id m2mr924919wiy.0.1358531546224; Fri, 18 Jan 2013 09:52:26 -0800 (PST) Path: o9ni5492wio.1!nntp.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Numerical calculations: Why not use fixed point types for everything? Date: Fri, 18 Jan 2013 10:52:23 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <4905b963-0036-4129-8050-fb26ef0154d6@googlegroups.com> <32314026-23ae-45b8-a4c5-e589e7d79de2@googlegroups.com> Mime-Version: 1.0 Injection-Date: Fri, 18 Jan 2013 17:52:26 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="656ea2f23126f57fb36504d2d15a002c"; logging-data="1504"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+L08OrYIbAu6TEU++EAL+aO8hJpkKQA5w=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 In-Reply-To: Cancel-Lock: sha1:f1hjFlIxg6+KpFRz6Cc+ioDGUUs= Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Date: 2013-01-18T10:52:23-07:00 List-Id: On 01/18/2013 10:24 AM, J-P. Rosen wrote: > Le 18/01/2013 10:17, Ada novice a �crit : >> I have read (John Mc Cormick: Building parallel...with Ada's book) >> that fixed point arithmetic is faster than floating-point arithmetic >> since integer instructions are faster > General advice: don't assume anything about speed unless you had a > chance to measure it. > > I heard a claim that with modern co-processors, floating point > arithmetic was faster than integer arithmetic. Since the claim was by > Robert Dewar, it is worth considering... When I started programming FORTRAN-66 on a CDC-6400 in 1975, floating-point operations were done in S/W and integer operations were significantly faster. On modern processors with FPUs, integer operations are not necessarily faster than floating-point. I don't know that floating-point operations are always faster than integer with FPUs, though. One advantage is that FPU operations can proceed in parallel with CPU operations. Pretty much everything I learned back in the good old days isn't true any more. In Pascal, we had to keep the universe of sets (implemented as packed arrays of Boolean) fairly small. But these days, with a 32-bit Integer, even type Set is array (Integer) of Boolean; for Set'Component_Size use 1; will fit into physical memory on many machines! -- Jeff Carter "I wave my private parts at your aunties." Monty Python & the Holy Grail 13