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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cc6a4bc415a41111 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.50.133 with SMTP id c5mr46790822pbo.2.1317401544444; Fri, 30 Sep 2011 09:52:24 -0700 (PDT) Path: lh7ni8417pbb.0!nntp.google.com!news1.google.com!goblin1!goblin2!goblin.stu.neva.ru!feeder.erje.net!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: fixed point vs floating point Date: Fri, 30 Sep 2011 18:52:23 +0200 Organization: cbb software GmbH Message-ID: References: <82lit6z64n.fsf@stephe-leake.org> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: EMY6V9w2JsuJ/8EEiAFEEw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:18240 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-09-30T18:52:23+02:00 List-Id: On Fri, 30 Sep 2011 16:25:22 +0000 (UTC), tmoran@acm.org wrote: > Intensities (eg color, sound) are always fractions, but they are usually > represented as if they were integers ranging from 0 .. 15, or 0 .. 255, > or 0 .. 65535. Code like > Is_Bright := (Color > 128); > is much more tedious and error-prone to change then > Is_Bright := (Color > 0.5); Right, but arithmetic of color-models intensities is not linear, so although a fixed point type would be far more convenient for color stimuli, it still would require redefinition of the operations. An addition to your list: screen units (horizontal, vertical coordinates). Traditionally rendering frameworks are using floating point for them, but I think that fixed point could be more suitable with regard of anti-aliasing issues etc. to the OP: Integer type is a special case of decimal fixed point. So I don't understand your desire to single out signed integer types them. However, for the modular ones, it would indeed make sense. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de