comp.lang.ada
 help / color / mirror / Atom feed
* Re: About conversions
@ 2000-11-23  6:21 Christoph Grein
  2000-11-23  0:00 ` Wilhelm Spickermann
  0 siblings, 1 reply; 24+ messages in thread
From: Christoph Grein @ 2000-11-23  6:21 UTC (permalink / raw)
  To: comp.lang.ada

-14 mod 5:

 There's a common rule: ("Punkt vor Strich" in German) multiplication (* / mod 
rem) before addition (+ -), thus this is
 
      -14 mod 5 = -2**2

You wouldn't fall into the latter trap, would you?

(Hope I'm correct, did not look it up in ARM :-)

What's

  -14 mod (-5)
  -14 rem (-5)

I don't know for sure without looking it up.





^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: About conversions
@ 2000-11-24  0:00 Christoph Grein
  2000-11-28  1:33 ` Robert Dewar
  0 siblings, 1 reply; 24+ messages in thread
From: Christoph Grein @ 2000-11-24  0:00 UTC (permalink / raw)
  To: comp.lang.ada

About -14 mod 5:

> Sorry, but "mod x" always delivers values between 0 and x (x excluded).
> So the result is 1 and not -4.

As always 0 - X = X = 0 + X:

0 - 14 mod 5 = -14 mod 5 = -(14 mod 5) /= (-14) mod 5 = 0 + (-14) mod 5






^ permalink raw reply	[flat|nested] 24+ messages in thread
* About conversions
@ 2000-11-20  0:00 Sandro Binetti
  2000-11-20  0:00 ` Ken Garlington
  0 siblings, 1 reply; 24+ messages in thread
From: Sandro Binetti @ 2000-11-20  0:00 UTC (permalink / raw)


Hi everybody.

Can you help me understand the meaning of a type conversion, like:
  INTEGER(v)  ?

Take an example like the following.

-------------------------

procedure PROVA is
  type TYP is range 1..10;
  c:typ;

  procedure P(a,b:in integer;result:out integer) is
  begin
    result:=a+b;
  end p;

begin -- PROVA
  p(10,20,INTEGER(c)); -- <<<<
end prova;

----------------------------------------


The compiler doesn't say anything at the point <<<<

Why?

--
Ciao, Sandro


Sent via Deja.com http://www.deja.com/
Before you buy.




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

end of thread, other threads:[~2000-11-28  2:20 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-23  6:21 About conversions Christoph Grein
2000-11-23  0:00 ` Wilhelm Spickermann
2000-11-23  0:00   ` Florian Weimer
2000-11-23  0:00     ` Wilhelm Spickermann
2000-11-28  2:20   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2000-11-24  0:00 Christoph Grein
2000-11-28  1:33 ` Robert Dewar
2000-11-20  0:00 Sandro Binetti
2000-11-20  0:00 ` Ken Garlington
2000-11-20  0:00   ` Robert Dewar
2000-11-20  0:00     ` Stephen Leake
2000-11-21  0:00       ` Robert Dewar
2000-11-21  0:00         ` Warren W. Gay VE3WWG
2000-11-21  0:00           ` Robert Dewar
2000-11-21  0:00             ` Ted Dennison
2000-11-22  3:27               ` Warren W. Gay VE3WWG
2000-11-22  4:54               ` Robert Dewar
2000-11-22  0:00                 ` Ted Dennison
2000-11-22  0:00                 ` Wes Groleau
2000-11-22  0:00         ` Tristan Gingold
2000-11-24  0:00         ` Jean-Pierre Rosen
2000-11-24  0:00       ` Jean-Pierre Rosen
2000-11-21  2:57     ` DuckE
2000-11-21  0:00       ` Robert Dewar

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