comp.lang.ada
 help / color / mirror / Atom feed
* casting types
@ 2014-10-01  1:49 Stribor40
  2014-10-01  2:06 ` Jeffrey Carter
  0 siblings, 1 reply; 19+ messages in thread
From: Stribor40 @ 2014-10-01  1:49 UTC (permalink / raw)


I have problem understanding this explicit conversion of types....

 var1: FLOAT;
 
 tmp := Float(x) / 20.0 + Float(y)/ 30.0 + Float(z)/40.0;
 return var1 - truncated type of var1

Example if var1 = 123.456 then
  return  123.456 - 123 

which is 0.123

How would I cast var1 to become 123 but still be able to subtract it from var1 and keep float type?


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-10-07  0:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01  1:49 casting types Stribor40
2014-10-01  2:06 ` Jeffrey Carter
2014-10-01  2:13   ` Stribor40
2014-10-01  2:56   ` Stribor40
2014-10-01 13:18     ` Dennis Lee Bieber
2014-10-01 13:55       ` Stribor40
2014-10-01 14:23         ` G.B.
2014-10-01 17:16           ` Stribor40
2014-10-01 17:38             ` Dirk Heinrichs
2014-10-02  1:47               ` Dennis Lee Bieber
2014-10-01 18:11         ` Jeffrey Carter
2014-10-02  9:21         ` Brian Drummond
2014-10-02  9:24     ` Brian Drummond
2014-10-03  3:35       ` Stribor40
2014-10-03  7:45         ` Björn Lundin
2014-10-03  8:29         ` Jacob Sparre Andersen
2014-10-06 23:36           ` brbarkstrom
2014-10-07  0:03             ` Jeffrey Carter
2014-10-07  0:21               ` brbarkstrom

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