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.68.117.230 with SMTP id kh6mr366596pbb.1.1360469025223; Sat, 09 Feb 2013 20:03:45 -0800 (PST) Path: mj10ni1789pbb.1!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.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!eternal-september.org!feeder.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: Mon, 04 Feb 2013 09:44:58 -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> <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 Injection-Date: Mon, 4 Feb 2013 16:44:37 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="656ea2f23126f57fb36504d2d15a002c"; logging-data="10450"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ig2smQCukfbD1eTbqV8E703alUUWnkgo=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Cancel-Lock: sha1:D3+G7ewrxtmXSWrZCfsbawapNR4= X-Received-Bytes: 2629 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2013-02-04T09:44:58-07:00 List-Id: On 02/04/2013 07:24 AM, Niklas Holsti wrote: > On 13-02-04 12:09 , Ada novice wrote: >> >> When assigning constants, I always use >> >> Number : constant := 100.0 >> >> and then lets the compiler decides how it wants to treat the constant >> when say multiplying with a type such as integer, > > (You can't multiply 100.0 with an integer, unless you do a type > conversion or define your own multiplication operator.) Sure you can. Twice : constant := 2 * Number; Half : constant := Number / 2; are both legal (ARM 4.5.5). -- Jeff Carter "I'm a lumberjack and I'm OK." Monty Python's Flying Circus 54