help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plotting even function


From: Geraint Paul Bevan
Subject: Re: plotting even function
Date: Sun, 20 Mar 2005 21:45:43 +0000
User-agent: Mozilla Thunderbird 0.5 (X11/20040306)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

address@hidden wrote:


> OK, if I understood correctly the very interesting discussion, in
> principle (a^b)^c==(a^c)^b (a is a real scalar) if, and only if
> b*c is a rational number.

This is not correct. Let b=pi (which is not rational) and the identity
will still hold true.

>From the laws of exponentiation, (a^b)^c is the same as a^(b*c).
Similarly (a^c)^b is the same as a^(c*b). As long as you are dealing
with real numbers rather than, say, matrices, multiplication is
commutative, i.e. b*c=c*b. Hence the identity holds for all real a, b
and c, rational or not.

> 592~> y=x.^(floor(1)/floor(3));
> 589~> plot(x,y) % I get the same plot, although floor(1) and
> floor(3) are integers.

I could be wrong, but I don't think that the floor() function is
necessary to get Octave to treat integers as such:

octave> format long
octave> 1.1
ans = 1.10000000000000
octave> 1.0
ans = 1
octave> floor(1)
ans = 1

Nevertheless, this could not work anyway. Although 1 and 3 would be
integers, the division would have to be performed before the
exponentiation and there is no way that 1/3 can be represented as an
integer, at least not without catastrophic loss of precision!

- --
Geraint Bevan
http://homepage.ntlworld.com/geraint.bevan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iEYEARECAAYFAkI97wYACgkQcXV3N50QmNOSGgCaA/hM+xTy3CMpQai90CmRz5mR
dvUAoIDQtDJ7/3FVCktVFqvIFbvp+3tt
=oB8Y
-----END PGP SIGNATURE-----



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]