comp.lang.ada
 help / color / mirror / Atom feed
From: Richard Riehle <richard@adaworks.com>
Subject: Re: Decimals after the point
Date: Sun, 17 Nov 2002 17:35:39 -0800
Date: 2002-11-18T01:28:14+00:00	[thread overview]
Message-ID: <3DD843EB.54704091@adaworks.com> (raw)
In-Reply-To: uL0z9.20698$og.38042@rwcrnsc52.ops.asp.att.net

SteveD wrote:

> "Genevieve B." <geneb@videotron.ca> wrote in message
>
> > I have an idea of putting my float into a string instead and then check
> for
> > the point...and then check for only 2 numbers after it...
> >
> I like your approach:
>   Straightforward.
>   Easy to understand.
>   Easy to verify.
>   Gets the job done.

I am reminded of a project that required reading floating point
numbers from a VAX on an another computer.   The project
involved data from a site that had just lost a contract and
they had to send the data to us.    The sign bit for the VAX
is smack-dab in the middle of the 32 bit word.  Our machine
had the sign bit in the high-order bit.

We first struggled with a alorithm to convert VAX floats to
our machine's floats.   Then we abandoned that.  Instead, we
bought time on a VAX, converted all the VAX float to textual
representation, and then read that into our system.

This can be done so easily with Text_IO.   The amazing thing
is that many Ada programmers still don't know this and I
still see some of them trying to write their own algorithms
to convert floating point values to strings and vice-versa.

Richard Riehle




  reply	other threads:[~2002-11-18  1:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06 23:01 Decimals after the point Genevieve B.
2002-11-06 22:08 ` Decimals after the point (school question) Larry Kilgallen
2002-11-07  2:06 ` Decimals after the point Dennis Lee Bieber
2002-11-08  3:50   ` Steven Deller
2002-11-09  5:08 ` SteveD
2002-11-18  1:35   ` Richard Riehle [this message]
2002-11-18  5:17     ` Dennis Lee Bieber
replies disabled

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