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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: jvl@ocsystems.com (Joel VanLaven) Subject: Re: Question on modular types Date: 1997/01/06 Message-ID: <1997Jan6.162846.37787@ocsystems.com>#1/1 X-Deja-AN: 208104567 references: <01bbfa96$66d516a0$8d2d5c8b@jerryware> organization: OC Systems, Inc. newsgroups: comp.lang.ada Date: 1997-01-06T00:00:00+00:00 List-Id: I think I know what the confusion is. The problem is that -1 is not a literal! -1 is actually -(1). 1 is a perfectly valid uint and the "-" operator is the modular "-" and so reduces the result back into the valid range. The problem really comes from the problem that we humans take -1 to be a literal but the language doesn't. I have been confused by that a few times myself, but in cases where it was more obvious what the problem was (subtyping an integer type and then not finding the "-" operator). -- -- Joel VanLaven