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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 107f24,626a0a064b320310 X-Google-Attributes: gid107f24,public X-Google-Thread: f4fd2,626a0a064b320310 X-Google-Attributes: gidf4fd2,public X-Google-Thread: 103d24,626a0a064b320310 X-Google-Attributes: gid103d24,public X-Google-Thread: 10259a,626a0a064b320310 X-Google-Attributes: gid10259a,public X-Google-Thread: 103376,ea8ea502d35ca2ce X-Google-Attributes: gid103376,public X-Google-Thread: 114809,626a0a064b320310 X-Google-Attributes: gid114809,public X-Google-Thread: 1164ba,626a0a064b320310 X-Google-Attributes: gid1164ba,public X-Google-ArrivalTime: 2001-05-31 07:10:15 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!195.25.12.36.MISMATCH!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada,comp.lang.lisp,comp.lang.smalltalk,comp.lang.basic,comp.lang.functional,comp.lang.scheme,comp.lang.perl Subject: Re: Beginner's Language? Date: Thu, 31 May 2001 15:51:47 +0200 Organization: Adalog Message-ID: <9f5j6p$58d$1@s1.read.news.oleane.net> References: <9cukad$nn68@news-dxb> <9d6b6e$1bt$1@nh.pace.co.uk> <87snihxiwc.fsf@frown.here> <9dbi83$sji$1@nh.pace.co.uk> <87heyu7cqd.fsf@frown.here> <9dc20p$hh15e$1@ID-37382.news.dfncis.de> <9dclnt$9ic1@news.cis.okstate.edu> <3B02C05B.BA4B63C6@raytheon.com> <8766ei7fct.fsf@deneb.enyo.de> <9f52c7$pqb$1@s1.read.news.oleane.net> <4npucpsl3r.fsf@rtp.ericsson.se> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 991318041 5389 195.25.228.57 (31 May 2001 14:07:21 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 31 May 2001 14:07:21 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:7930 comp.lang.lisp:11048 comp.lang.smalltalk:10369 comp.lang.functional:5997 comp.lang.scheme:4080 comp.lang.perl:3066 Date: 2001-05-31T15:51:47+02:00 List-Id: "Raymond Toy" a �crit dans le message news: 4npucpsl3r.fsf@rtp.ericsson.se... > Why is multiplication/division much harder? You pretend the numbers > of integers, do the operation, and then figure out where the fixed > point should be. That's not too hard. As a DSP guy working on > fixed-point DSPs, we do this all the time. > Yes, you "just" have to figure out where the fixed point should be. Note that the result has twice more digits after the point than the original operands. This means that there is some rounding involved, and of course if you want to meet the numerics annex requirements, this should be done right. And did you consider the case where operands are of different fixed point types, with different smalls, and the expected result type is a third fixed point type, or even a floating point type ? And of course, you should consider arbitrary smalls, not just powers of 2... That makes determining the correct rounding of the result more interesting. Of course, it is doable. Compilers do it all the time. But why bother to reinvent the wheel, when the compiler provides a carefully tested implementation ? -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr