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: 10a146,fee8802cc3d8334d X-Google-Attributes: gid10a146,public X-Google-Thread: 103376,fee8802cc3d8334d X-Google-Attributes: gid103376,public From: kirck@nospam.com Subject: Re: Ada and Java. different behaviour. casting long to int problem. Date: 1999/06/12 Message-ID: <7jv4bh$11rg@drn.newsguy.com>#1/1 X-Deja-AN: 488967875 References: <7jt2c0$vrb@drn.newsguy.com> Newsgroups: comp.lang.ada,comp.lang.java.programmer Date: 1999-06-12T00:00:00+00:00 List-Id: In article , Keith says... > >stt@houdini.camb.inmet.com (Tucker Taft) writes: >> Integer conversion (casting) in Java is truncating. > >Actually, Java follows *de facto* C/C++ semantics. In C and C++, >unsigned integer arithmetic is defined to wrap around, but overflow on >signed integer arithmetic produces undefined behavior. Ok, so the bottom line of all this, is that Java (and C and C++) all blew it, and Ada did not. I hope I do not see Java used to implement the software that will launch the next rocket to space, or process my bank financial statment. I'd rather see a language that catches such basic errors on the spot like Ada did in the example, not hide them under the cover. Kirck.