🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #2026

Re: Overloading?

#2026
From: Ben Stuyts
Date: Sat, 27 Apr 1991 07:12
27 lines
1259 bytes
 >> a := Add(Mul(b,c),d);
 >> instead of the more readable:
 >> a := b*c+d;
 WA> 
 WA> If you have
 WA> 
 WA> TYPE    FIXED=INTEGER;
 WA> 
 WA> then + and - work fine, so you don't need Add & Sub, but Mul and
 WA> Div require shifting.

Well, as I stated in a message to George Emery, the problem is not only
the shifting, but also the possiblity of overflow.

Furthermore, putting all my routines in a single fixed point module
enable me to play a bit with different representations of fixed
point numbers. This enables me to get optimum range and accuracy in
my particular program. (I hope. B-))

Best regards,
Ben


--  
uucp: uunet!m2xenix!puddle!2!281!202.6!Ben.Stuyts
Internet: Ben.Stuyts@p6.f202.n281.z2.fidonet.org
Technical Details
Message-ID: <1861.281C3566@puddle.fidonet.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!ogicse!qiclab!percy!m2xenix!puddle!p6.f202.n281.z2.fidonet.org!Ben.Stuyts

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!ogicse!qiclab!percy!m2xenix!puddle!p6.f202.n281.z2.fidonet.org!Ben.Stuyts
From: Ben.Stuyts@p6.f202.n281.z2.fidonet.org (Ben Stuyts)
Newsgroups: comp.lang.modula2
Subject: Re: Overloading?
Message-ID: <1861.281C3566@puddle.fidonet.org>
Date: 27 Apr 91 07:12:20 GMT
Sender: ufgate@puddle.fidonet.org (newsout1.26)
Organization: FidoNet node 2:281/202.6 - ST Quick BBS Haarle, Haarlem Holland
Lines: 27