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: D'Arcy Smith Subject: Re: Ada and Java. different behaviour. casting long to int problem. Date: 1999/06/16 Message-ID: <37676A16.AFF5CB03@itools.symantec.com>#1/1 X-Deja-AN: 490183043 Content-Transfer-Encoding: 7bit References: <7jt2c0$vrb@drn.newsguy.com> <7k57vb$1ipf@drn.newsguy.com> <3766650F.705125B7@pwfl.com> <7k64t7$igo$1@its.hooked.net> <7k689a$ci2@drn.newsguy.com> <3766C842.E1EAB60A@pwfl.com> <3766D1CC.D712895E@itools.symantec.com> To: Keith Thompson X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@itools.symantec.com X-Trace: it.visualcafe.com 929524102 16351 155.64.77.40 (16 Jun 1999 09:08:22 GMT) Organization: Internet Tools Division, Symantec Corp. Mime-Version: 1.0 NNTP-Posting-Date: 16 Jun 1999 09:08:22 GMT Newsgroups: comp.lang.ada,comp.lang.java.programmer Date: 1999-06-16T09:08:22+00:00 List-Id: Keith Thompson wrote: > > D'Arcy Smith writes: > > If you're sent into a room that is full of pins sticking up from the > > floor - and you are told that it is full of pins - and you run into > > the room with your eyes closed then it is 100% your fault. > (I took the liberty of correcting some typos in the quoted text.) But I took so long to get them in... :-) I am probably the worlds worst person when it comes to typing. > If I hire someone to build me a house, and the living room is full of > pins sticking up from the floor -- and the builder clearly tells me > about this feature -- it's my fault if I run into the living room with > my eyes closed. But I'm going to be a bit upset with the builder for > building it that way in the first place. Sure you can be upset... I don't disagree that checking for overflows would be nice to have (perhaps even necessary)... but to say that it is the fault of the designers that people do not follow the spec is silly. > For any arithmetic operation on integers, you will get the > mathematically correct result if it fits in the representation; > otherwise, you will get a mathematically incorrect (but perhaps > well-defined) result, with no straightforward way to detect that > it's mathematically incorrect. I don;t care if the spec says it can format my hard-drive if the thing overflows... :-) If it says that and some programmer does it then the fault lies 100% with the programmer. > This assumes, of course, that the abstraction you're trying to > (partially) model is the mathematical set of integers -- which it > usually is. Some people have argued that wraparound semantics, if > they're well-defined, are as "correct" as anything else. Sorry, but I > don't buy it. Whatever... it is in the spec so there is no excuse to plead ignorance about it. ..darcy -- D'Arcy Smith Sr. Software Engineer Symantec, Internet Tools Division If you simply reply to this email it will get forwarded to /dev/null My Email address is darcy at itools dot symantec dot com