🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #2298

Re: Why no ** operator in Modula2?

#2298
From: Ronald Cole
Date: Tue, 04 Jun 1991 17:54
21 lines
1758 bytes
In article <1302.284A5A7F@puddle.fidonet.org> Ben.Stuyts@p6.f202.n281.z2.fidonet.org (Ben Stuyts) writes:
   dww@math.fu-berlin.de (Debora Weber-Wulff) writes:

    DW> The question came up in class today: Why is there no ** or ^
    DW> (x to the nth power) operator in standard Modula2?
    DW> To make you start your own private module collection of goodies?
    DW> Because it is machine dependant???

   Probably because it is the spirit of Wirth's languages that they are
   easy to parse and it is easy to generate code for the underlying machine
   architecture. And as there are usually no 'power' type instructions, Wirth
   did not add it to the language but put it in the MathLib library instead.

Because x ** y is written in Modula-2 as MathLib0.exp(y * MathLib0.log(x)).
It's so obvious that Wirth didn't even bother to mention it in his book! :-)

--
Ronald Cole           +----------------------+  internet: rjc@unify.com
Software Engineer II  | This space for rent. |  uucp:     uunet!unify!rjc
Unify Corporation     +----------------------+  voice:    +1 916 928 6238
 "Relax. What is mind? No matter. What is matter? Never mind!" - Homer Simpson
Technical Details
Message-ID: <RJC.91Jun4105446@devo.unify.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!ucdavis!csusac!unify!unify!rjc
References: <1302.284A5A7F@puddle.fidonet.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!ucdavis!csusac!unify!unify!rjc
From: rjc@devo.unify.com (Ronald Cole)
Newsgroups: comp.lang.modula2
Subject: Re: Why no ** operator in Modula2?
Message-ID: <RJC.91Jun4105446@devo.unify.com>
Date: 4 Jun 91 17:54:46 GMT
References: <1302.284A5A7F@puddle.fidonet.org>
Sender: news@Unify.Com (news admin)
Organization: Unify Corporation, Sacramento, California
Lines: 21
In-Reply-To: Ben.Stuyts@p6.f202.n281.z2.fidonet.org's message of 31 May 91 03:50:40 GMT