[PD] pow with negative numbers
Chris McCormick
chris at mccormick.cx
Sun Jun 7 02:38:00 CEST 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Max,
On 07/06/15 00:44, Max wrote:
> I'm trying to get [pow 2] from -0.019022952498528478. however, in
> Python and my on-screen pocket calculator I get
> -0.019022952498528478**2 -0.0003618727217612709
>
> so apart from the 32 bit float, shouldn't the result be negative?
Here's what I get with Python:
$ python
>>> pow(-0.019022952498528478, 2)
0.0003618727217612709
>>> -0.019022952498528478 ** 2
- -0.0003618727217612709
So the "**" operator behaves differently from "pow(x, 2)".
Cheers,
Chris.
- --
http://mccormick.cx/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iD8DBQFVc5JoCdjIil9lUVoRAiA7AKCYW9s14bTeXU6jo5MiPl32DgjTcgCffY5C
MYBL0xglkXdqsoGhlU2bsHM=
=XCDi
-----END PGP SIGNATURE-----
More information about the Pd-list
mailing list