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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,6a8952cbe009f3ed,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.190.193 with SMTP id dj1mr2873916qab.6.1358418809092; Thu, 17 Jan 2013 02:33:29 -0800 (PST) X-Received: by 10.49.116.34 with SMTP id jt2mr978934qeb.38.1358418808975; Thu, 17 Jan 2013 02:33:28 -0800 (PST) Path: k2ni675qap.0!nntp.google.com!p13no965147qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 17 Jan 2013 02:33:28 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=130.240.232.139; posting-account=Rr9I-QoAAACS-nOzpA-mGxtAlZ46Nb6I NNTP-Posting-Host: 130.240.232.139 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Numerical calculations: Why not use fixed point types for everything? From: Ada novice Injection-Date: Thu, 17 Jan 2013 10:33:29 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-01-17T02:33:28-08:00 List-Id: Hello, I have been thinking that since with floating-point representation the= distribution of model numbers gets worse (more and more wider spacing) wit= h large numbers leading to less accurate representation of a number, is it = better to just go for fixed-point types e.g. in type Position is delta 1.0**(-12) range 0.0 to 100_000 and define every variable similarly so that we have an equally spaced distr= ibution of the model numbers between the lower and upper bounds? Why not just fixed-point types in numerical calculations? And why not just use decimal fixed point types as in type Velocity is delta 1E-10 digits 15=20 for example if we know what magnitudes of the Velocity are to be expected? I understand that it is a question of portability as well as the actual del= ta that would be used would perhaps not be the same for all machines and fo= r all compilers. Thanks, YC