comp.lang.ada
 help / color / mirror / Atom feed
From: eagle!cw
Subject: Rounding of Fixed Point in Ada
Date: Mon Nov  1 02:32:41 1982
Date: 1982-11-01T02:32:41+00:00	[thread overview]
Date: Mon Nov  1 00:27:01 1982
Message-ID: <bnews.eagle.589> (raw)
In-Reply-To: bnews.duke.2715


A recent article refers to Ada fixed point as a kind of
"poor man's floating point."  It is not that at all.
First, it is in the language not because the designers necessarily
wanted it there, but because the language specifications demanded it.
Second, it attempts to provide the facility to manipulate data with a
truly fixed radix point.  The most common instance of this kind
of data is money (with exactly two decimal places in the US), but much 
sensor data also has this property.  Remember that Ada is a
language for programs that handle real world external data.

Third, the radix for fixed point numbers is (implicitly) binary,
albeit the delta can be expressed in decimal.  Finally, although
the rounding rules are not easy to explain for Ada numbers
(either fixed point or floating point), they are considerably
more precise than are the rules in most languages.  Should
a program be one where detailed rounding control is necessary,
Ada is more likely to provide that control than other languages.

If there is to be more Ada discussion, should it be moved to
net.lang.ada?

Charles



      reply	other threads:[~1982-11-01  2:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1982-11-01  2:11 Problems in C and Ada duke!bcw
1982-11-01  2:32 ` eagle!cw [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox