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: a07f3367d7,6a8952cbe009f3ed X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.78.232 with SMTP id e8mr778566pax.29.1360469025395; Sat, 09 Feb 2013 20:03:45 -0800 (PST) Path: oq8ni1865pbb.0!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!goblin1!goblin.stu.neva.ru!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Numerical calculations: Why not use fixed point types for everything? Date: Mon, 04 Feb 2013 23:20:15 +0200 Organization: Tidorum Ltd Message-ID: References: <4905b963-0036-4129-8050-fb26ef0154d6@googlegroups.com> <32314026-23ae-45b8-a4c5-e589e7d79de2@googlegroups.com> <64e3c342-d042-40a2-8a16-b1f0cdff9f16@googlegroups.com> <91527f7c-0679-4c21-95c7-a07f3fff265d@googlegroups.com> <8cc51443-23f6-4736-a862-d0223998fc2e@googlegroups.com> <753a3719-e15f-4626-b3cc-ac76f7ef7499@googlegroups.com> <8ee504a6-b371-42ef-a91e-bbb70e3b81d8@googlegroups.com> <2665b0e1-0558-45ac-9a26-7eb7a1ecd689@googlegroups.com> Mime-Version: 1.0 X-Trace: individual.net KKwYibefFYNVFe6ny7o0sQLZY+aB+Tqxi/bvOhfmF6sgRWMpWfp8iiF7YvbEk08co9 Cancel-Lock: sha1:hQbdFYDBvd7dOA97CthulnYo5DM= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2013-02-04T23:20:15+02:00 List-Id: On 13-02-04 19:31 , Robert A Duff wrote: > Niklas Holsti writes: > >> Depends. Such type-less "named numbers" (in Ada-speak) have different >> properties than typed constant objects: if you combine them in an >> expression, the compiler uses unbounded-precision and unbounded-range >> arithmetic, ... > > That's true for all static expressions, not just ones involving > named numbers. Yes. But the rules for what expression are static are a bit complex (or at least longish), while using only named numbers is a simple rule of thumb for me. Moreover, the compiler will complain if the expression for a named number is not static for some reason, but will accept a non-static expression for a constant object. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .