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.2 required=5.0 tests=BAYES_00,FROM_WORDY, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,e01bd86884246855 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,fb1663c3ca80b502 X-Google-Attributes: gid103376,public From: "Ken Garlington" Subject: Re: Interresting thread in comp.lang.eiffel Date: 2000/07/11 Message-ID: #1/1 X-Deja-AN: 645228061 References: <8ipvnj$inc$1@wanadoo.fr> <8j67p8$afd$1@nnrp1.deja.com> <395886DA.CCE008D2@deepthought.com.au> <3958B07B.18A5BB8C@acm.com> <395A0ECA.940560D1@acm.com> <8jd4bb$na7$1@toralf.uib.no> <8jfabb$1d8$1@nnrp1.deja.com> <8jhq0m$30u5$1@toralf.uib.no> <8jt4j7$19hpk$1@ID-9852.news.cis.dfn.de> <3963CDDE.3E8FB644@earthlink.net> <3963DEBF.79C40BF1@eiffel.com> <396502D2.BD8A42E7@earthlink.net> <6aHa5.113$6E.23141@ptah.visi.com> <396B4A68.458FA3BC@maths.unine.ch> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Complaints-To: abuse@flash.net X-Trace: news.flash.net 963353333 216.215.78.115 (Tue, 11 Jul 2000 17:08:53 CDT) Organization: FlashNet Communications, http://www.flash.net X-MSMail-Priority: Normal NNTP-Posting-Date: Tue, 11 Jul 2000 17:08:53 CDT Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 2000-07-11T00:00:00+00:00 List-Id: "Bob Allen" wrote in message news:u6hp4i16$GA.283@cpmsnbbsa07... > I hate reverting to overly simplistic examples, but I do not want to write a > book on > this subject so here goes. > > Given the following methods of some math class, what is the semantics of > each? > REAL square_root(X:INTEGER) > REAL inv(X:INTEGER) > REAL tan(theta:REAL) > > square_root called with X = -1, what happens? > exception, return a value indicating an error, return > 0, -square_root(abs(X)), or somthing else > Who should check if X < 0? > for inv who checks for X = 0 > is the result an exception or MAX_REAL > for tan what happens if theta is a mutiple of 90+(180*n) or 270+(180*n) > degrees? Just out of curiosity: For "tan", what does the contract look like to specify... If theta is in degrees or radians? The resources (CPU time, memory, etc.) required to use tan? The precision and range of the result? (given that the contract may be coded in Eiffel while the implementation is coded in C...) (and you thought this was an overly simplistic example... :)