comp.lang.ada
 help / color / mirror / Atom feed
* How casting works in ada?
@ 2004-11-23 17:26 Abbo
  2004-11-23 19:17 ` Jeffrey Carter
  0 siblings, 1 reply; 2+ messages in thread
From: Abbo @ 2004-11-23 17:26 UTC (permalink / raw)


Hello! SOrry for this very basic question, but I'd like to know what 
happen during a simple casting between types with different size/delta. 
Example:

type one is delta 0.003 range -20.0 .. 200.0;
type two is digits 6 range -10.0 .. 400.0;
type three is delta 0.0023142 range -200.0.. 9999.0;

VAR1 : one := 23.0;
VAR2 : two;
VAR3 : three;

VAR2 := two ( VAR1 );
VAR3 := three (VAR1);

which values are in VAR2 and VAR3 and how ADA calculates it?

Why

VAR2 := two(23.0);

gives different value for VAR2 from

VAR2 := two ( VAR1 );   ??


Thanks in advance!!



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

end of thread, other threads:[~2004-11-23 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-23 17:26 How casting works in ada? Abbo
2004-11-23 19:17 ` Jeffrey Carter

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