From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c462e8ad74872a98 X-Google-Attributes: gid103376,public From: "Jerry van Dijk" Subject: Re: Question on modular types Date: 1997/01/06 Message-ID: <01bbfbf8$4fda7a40$5f2d5c8b@jerryware>#1/1 X-Deja-AN: 208096116 references: <01bbfa96$66d516a0$8d2d5c8b@jerryware> organization: *JerryWare HQ*, Haarlem, Holland newsgroups: comp.lang.ada Date: 1997-01-06T00:00:00+00:00 List-Id: Robert Dewar wrote in article ... >> "Clearly, all values are invalid, and that without inporting any >> values from the outside world." > No! If it is clear to you, you need your Ada prescription fixed :-) Mmmm, I'm afraid if I asked my docter for that, I might wind up with a totally different prescription... :-) > A := -1; > -1 is not a literal here, it is an expression, and the unary minus > operator is a modular unary minus. This is a useful, intended, and > clearly documented facility. Yes, I found it: 4.5.4(3): For modular integer types, the unary adding operator -, when given a nonzero operand, returns the result of subtracting the value of the operand from the modulus; for a zero operand, the result is zero. type Byte is mod 256; A_Byte : Byte; A_Byte := -1; -- means A_Byte := Byte (Byte'Modulus - 1); However, 4.5.4(1) mentions that all unary adding operators have their conventional meaning, and since the note is not technically part of the standard, that leaves me wondering wat that 'conventional meaning; might be. And 'conventional' to whom ? Thanks, Jerry.