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.180.19.66 with SMTP id c2mr1820653wie.6.1360478710222; Sat, 09 Feb 2013 22:45:10 -0800 (PST) Path: bp2ni28189wib.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.138.MISMATCH!xlned.com!feeder5.xlned.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsgate.cuhk.edu.hk!goblin2!goblin3!goblin.stu.neva.ru!news-1.dfn.de!news.dfn.de!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 11:37:49 +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 J+ZTCwg979YYRZNe/ho8zgOoNlw4I3K0hPjnvnCe58igx9TAwhbl6V+qB9ccgurDSd Cancel-Lock: sha1:+8k4dUFOYx9sUJw+4uXp6eeSd8A= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: <2665b0e1-0558-45ac-9a26-7eb7a1ecd689@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2013-02-04T11:37:49+02:00 List-Id: On 13-02-04 09:27 , Ada novice wrote: > On Monday, February 4, 2013 7:43:14 AM UTC+1, Niklas Holsti wrote: >> >> Number2 := Long_Float (Index) * Number; > > > Beginner's mistake! Thanks. Perhaps Ada could have helped to avoid this mistake? You could have thought about how you intended to use the Number variable, when you declared it. If you did not intend to change it, you could have declared it constant: Number : constant Long_Float := 100.0; and then the compiler would have complained about the assignment statement which changes Number. In experimental programs like this, one often forgets to think about constant vs variable, or about proper names for variables. But on the average, I think it saves time, even when one is experimenting. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .