comp.lang.ada
 help / color / mirror / Atom feed
From: ucaa2385@alpha1.csv.ica.uni-stuttgart.de (Peter Hermann)
Subject: Re: Truncation of FLOAT values
Date: 1996/04/19
Date: 1996-04-19T00:00:00+00:00	[thread overview]
Message-ID: <4l80u7$1de2@info4.rus.uni-stuttgart.de> (raw)
In-Reply-To: 4l6bjn$b96@cliffy.lfwc.lockheed.com

Cordes MJ (l117593@cliffy.lfwc.lockheed.com) wrote:
: Franz Kruse (Franz.Kruse@erno.de) wrote:
: : Is there a simple way in Ada 83 to determine the integer part or the fraction part
: : of a FLOAT value?
: : A conversion to INTEGER cannot be used, because it rounds.
: If your compiler rounds, then you can simply add 0.5 to the FLOAT value
: prior to converting it an INTEGER. You get the fractional part by 
: converting the result back to FLOAT and subtracting it from the 
: original FLOAT value.

I am looking into LRM A.5.3(18-62)
Why not using such attributes like fraction, compose,floor,ceiling,etc. etc. ?

--
Peter Hermann  Tel:+49-711-685-3611 Fax:3758 ph@csv.ica.uni-stuttgart.de
Pfaffenwaldring 27, 70569 Stuttgart Uni Computeranwendungen
Team Ada: "C'mon people let the world begin" (Paul McCartney)




  parent reply	other threads:[~1996-04-19  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-18  0:00 Truncation of FLOAT values Franz Kruse
1996-04-18  0:00 ` Cordes MJ
1996-04-19  0:00   ` Robert Dewar
1996-04-20  0:00     ` Cordes MJ
1996-04-21  0:00       ` Robert Dewar
1996-04-19  0:00   ` Peter Hermann [this message]
1996-04-19  0:00   ` John Herro
1996-04-19  0:00     ` Robert Dewar
1996-04-22  0:00       ` John Herro
1996-04-22  0:00     ` Robert I. Eachus
replies disabled

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