Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #53409
| From | Cecil Bayona <cbayona@cbayona.com> |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: Question on exponentiation |
| Date | 2016-12-18 12:14 -0600 |
| Organization | A noiseless patient Spider |
| Message-ID | <o36jk6$8e6$1@dont-email.me> (permalink) |
| References | <o35791$99j$1@dont-email.me> |
On 12/17/2016 11:37 PM, Ron Aaron wrote: > One of my users complained that in 8th, "-2 2 ^" gives "4" while python > (and google's calculator, etc) gives "-4". > > I maintain that "-2 2 ^" is equivalent to "-2 -2 *" and therefore must > be "4". But clearly there are programs (and authors thereof) which > disagree. > > Can anyone shed light on why python gives the answer it does, and > whether or not I'm just crazy to expect -2 2 ^ to give the answer 4 ? > Basic math 101 any negative number raised to an even power is positive, raised to an odd power it is negative, that is for positive powers. -- Cecil - k5nwa
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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