[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: imaginary unit
From: |
Przemek Klosowski |
Subject: |
Re: imaginary unit |
Date: |
Thu, 27 Apr 2006 13:52:31 -0400 (EDT) |
On 4/26/06, Przemek Klosowski <address@hidden> wrote:
> Perhaps the use of predefined 'i' should elicit a warning?
That would be a rather annoying warning. Octave is built with
Agreed, of course; the ideal warning would only happen when you
use 'i' as an imaginary unit---but of course Octave has no way
of knowing your intentions. Perhaps warning should trigger when
'i' (et al) is changed _away_from_ the imaginary unit? That would
only trigger once.
This actually might be a good idea---behold 'pi' (3.1416); you
can make like Indiana and set 'pi=3' and it'll do it quietly, just
like it would let you define Inf=0, eps=1, e=2, etc.
The famous Euler equation e^(i*pi)+1=0 suddenly starts looking
sinister when you realize that all of 'e', 'i' and 'pi' can change :)
I don't think making the builtin variables readonly is a good idea:
people want to use 'i' as index, and setting 'eps' to different values
might actually be useful to test and tune convergence.
So, what about a warning when changing predefined constants?
By the way, Mathematica for instance uses I,E, etc, and they are
readonly:
In[8]= I*I
Out[8]= -1
In[9]:= I=1
Set::wrsym: Symbol I is Protected.
p
Re: imaginary unit, Marek Szczypinski, 2006/04/27
Re: imaginary unit, Javier Arantegui, 2006/04/27
Re: imaginary unit, Robert A. Macy, 2006/04/27
Re: imaginary unit, Bill Denney, 2006/04/28