From: Eric Smith <eric at brouhaha.com>
David Cantrell wrote:
I wish there was a widely available, widely
known general purpose
programming language which had a "number with precision" type, which
would Do The Right Thing when doing things like multiplying values
together - ie, decreasing the precision - and would let you specify a
required minimum precision for results or function parameters, with
exceptions being thrown if those can't be achieved.
vintagecoder at
aol.com wrote:
> I am almost certain Ada 95 provides this. You can certainly specify the
> number of digits of precison and create your own type or subtype
Yes.
and I
believe the runtime automatically protects you from loss of precision.
Even if it automatically protected you from loss of
precision, which it
doesn't,
Ada 95 Reference Manual ISO/IEC 8652:1995(E) p. 45 section 3.5.9 Fixed
Point Types:
"A fixed point type is either an ordinary fixed point type, or a decimal
fixed point type. The error bound of a fixed point type is specified as an
absolute value, called the delta of the fixed point type."
That suggests to me there is a guarantee against loss of precision. Why do
you feel otherwise?
that isn't what David was asking for, or is only a
small part of it.
I'm sure he's glad you're his mom. Maybe you could let him speak for himself
and we can hear what he thinks.