Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #53416

Re: Question on exponentiation

From rickman <gnuarm@gmail.com>
Newsgroups comp.lang.forth
Subject Re: Question on exponentiation
Date 2016-12-18 19:12 -0500
Organization A noiseless patient Spider
Message-ID <o378ij$mb2$1@dont-email.me> (permalink)
References (1 earlier) <o35s9m$ssa$1@cherry.spenarnc.xs4all.nl> <o35s5g$vnu$1@dont-email.me> <87oa0827si.fsf@nightsong.com> <o373bm$351$1@dont-email.me> <87k2aw26jm.fsf@nightsong.com>

Show all headers | View raw


On 12/18/2016 5:53 PM, Paul Rubin wrote:
> rickman <gnuarm@gmail.com> writes:
>>> You really expect -x**2 and x**2 to be the same thing?
>> What happens in other languages.  I believe most do exactly that.
>
> None that I can think of offhand do that.  Similarly in mathematical
> notation, -x**2 is -(x**2) where the **2 is written as a superscript.

 From wikipedia...

"There exist differing conventions concerning the unary operator − 
(usually read "minus"). In written or printed mathematics, the 
expression −32 is interpreted to mean 0 − (32) = −9,[1][5] but in some 
applications and programming languages, notably Microsoft Office Excel 
(and other spreadsheet applications) and the programming language bc, 
unary operators have a higher priority than binary operators, that is, 
the unary minus (negation or +/-) has higher precedence than 
exponentiation, so in those languages −32 will be interpreted as (−3)2 = 
9.[6]"

I noticed that C does not have an exponential operator.  So they avoided 
the issue altogether.

-- 

Rick C

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Question on exponentiation Ron Aaron <rambamist@gmail.com> - 2016-12-18 07:37 +0200
  Re: Question on exponentiation Julian Fondren <julian.fondren@gmail.com> - 2016-12-17 21:45 -0800
    Re: Question on exponentiation Ron Aaron <rambamist@gmail.com> - 2016-12-18 07:46 +0200
  Re: Question on exponentiation albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-12-18 12:35 +0100
    Re: Question on exponentiation Ron Aaron <rambamist@gmail.com> - 2016-12-18 13:33 +0200
      Re: Question on exponentiation Richmond <dnomhcir@gmx.com> - 2016-12-18 18:07 +0000
        Re: Question on exponentiation albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-12-19 14:00 +0100
      Re: Question on exponentiation rickman <gnuarm@gmail.com> - 2016-12-18 15:45 -0500
      Re: Question on exponentiation Paul Rubin <no.email@nospam.invalid> - 2016-12-18 14:26 -0800
        Re: Question on exponentiation rickman <gnuarm@gmail.com> - 2016-12-18 17:43 -0500
          Re: Question on exponentiation Paul Rubin <no.email@nospam.invalid> - 2016-12-18 14:53 -0800
            Re: Question on exponentiation rickman <gnuarm@gmail.com> - 2016-12-18 19:12 -0500
              Re: Question on exponentiation Julian Fondren <julian.fondren@gmail.com> - 2016-12-18 16:56 -0800
          Re: Question on exponentiation Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-12-19 02:52 -0600
  Re: Question on exponentiation john <anon@example.com> - 2016-12-18 12:21 +0000
  Re: Question on exponentiation Cecil Bayona <cbayona@cbayona.com> - 2016-12-18 12:14 -0600
    Re: Question on exponentiation rickman <gnuarm@gmail.com> - 2016-12-18 15:48 -0500

csiph-web