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,fee8802cc3d8334d X-Google-Attributes: gid103376,public X-Google-Thread: 10a146,fee8802cc3d8334d X-Google-Attributes: gid10a146,public From: "Mike Silva" Subject: Re: Ada and Java. different behaviour. casting long to int problem. Date: 1999/06/15 Message-ID: <7k64t7$igo$1@its.hooked.net>#1/1 X-Deja-AN: 489942427 References: <7jt2c0$vrb@drn.newsguy.com> <7k57vb$1ipf@drn.newsguy.com> <3766650F.705125B7@pwfl.com> Organization: Whole Earth Networks News X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada,comp.lang.java.programmer Date: 1999-06-15T00:00:00+00:00 List-Id: I agree completely. To my mind, quietly producing a non-intuitive result (via truncation or wraparound) is in the same league as being able to quietly step off the end of an array (something the Java folks beat up on the C/C++ folks about constantly). Mike Marin David Condic wrote in message <3766650F.705125B7@pwfl.com>... >I'm of the opinion that if one wishes behavior different from that of >"normal" arithmetic, then this should be specified by a type with >special properties. One acustomed to normal arithmetic is going to >believe that X := X + 1 will yield the successor of X in the set of all >integer numbers. If that isn't possible because of real world >limitations, then we have encountered an exceptional condition which >ought to raise some sort of flag and warn the world that the anticipated >behavior was not achieved.