Just evaluating
1.1 I
returns
0. +1.1
It seems a purely cosmetic issue but it does look a rather
"untraditional". Can anyone confirm that this is indeed an intentional
change?
Andrzej Kozlowski
On 20 Mar 2011, at 12:44, Andrzej Kozlowski wrote:
> Chop does not seem to work properly in Mathematica 8.0.1:
>
> f[a_] := 2 I Pi Sin[a]/a
>
> In[2]:= f[1.]
>
> Out[2]= 0. + 5.287118128162912*I
>
> In[3]:= Chop[%]
>
> Out[3]= 0. + 5.287118128162912*I
>
> This is with
>
> In[4]:= $Version
>
> Out[4]= 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
>
> Mathematica 7.01 returns 5.287118128162912*I as expected.
>
> Can anyone confirm it? At the moment I can't see any simple work
around...
>
> Andrzej Kozlowski
In[1]:= 1.1 I
Out[1]= 0. + 1.1 I
In[2]:= 1.1 I // TraditionalForm
Out[2]//TraditionalForm= 0. +1.1 i
Cheers .... Syd
Syd Geraghty B.Sc, M.Sc.
Mathematica 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
ReleaseID: 8.0.1.0 (2063982, 2063639)
MacOS X V 10.6.5 Snow Leopard
MacBook Pro 2.33 GHz Intel Core 2 Duo 2GB RAM
On Mar 21, 2011, at 7:12 AM, Andrzej Kozlowski wrote:
> Hmm... perhaps this is not a bug but a deliberate new design?
>
> Just evaluating
>
> 1.1 I
>
> returns
>
> 0. +1.1
>
> It seems a purely cosmetic issue but it does look a rather
> "untraditional". Can anyone confirm that this is indeed an intentional
> change?
>
> Andrzej Kozlowski
>
>
>
> On 20 Mar 2011, at 12:44, Andrzej Kozlowski wrote:
>
In[1]:= f[a_] := 2*I*Pi*(Sin[a]/a)
f[1.]
Chop[%]
$Version
Out[2]= 0. + 5.287118128162912*I
Out[3]= 0. + 5.287118128162912*I
Out[4]= "8.0 for Microsoft Windows (32-bit) (February 24, 2011)"
In reality version 8.0.1.
Best regards,
MATTHIAS BODE
S 17.35775=B0, W 066.14577=B0
2'740 m
AMSL.
> Date: Mon, 21 Mar 2011 06:18:18 -0500
> From: ak...@mimuw.edu.pl
> Subject: Chop in Mathematica 8.0.1
> To: math...@smc.vnet.net
Hello Andrzej,
Is it possible that this is just a change in how complex numbers are
displayed? Consider
{0 + I, 1. I, 1 + 0. I}
(the 2nd and 3rd are machine precision)
It appears that the real part of non-exact numbers is always displayed,
even if it is (0.).
> Hmm... perhaps this is not a bug but a deliberate new design?
>
> Just evaluating
>
> 1.1 I
>
> returns
>
> 0. +1.1
>
> It seems a purely cosmetic issue but it does look a rather
> "untraditional". Can anyone confirm that this is indeed an intentional
> change?
>
> Andrzej Kozlowski
>
For example,
Developer`PackedArrayQ@Developer`ToPackedArray[{1. + I, 1.1 I}]
Oliver
>
>
> On 20 Mar 2011, at 12:44, Andrzej Kozlowski wrote:
>
>> Chop does not seem to work properly in Mathematica 8.0.1:
>>
>> f[a_] := 2 I Pi Sin[a]/a
>>
>> In[2]:= f[1.]
>>
>> Out[2]= 0. + 5.287118128162912*I
>>
>> In[3]:= Chop[%]
>>
>> Out[3]= 0. + 5.287118128162912*I
>>
>> This is with
>>
>> In[4]:= $Version
>>
>> Out[4]= 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
>>
>> Mathematica 7.01 returns 5.287118128162912*I as expected.
>>
>> Can anyone confirm it? At the moment I can't see any simple work
> around...
>>
>> Andrzej Kozlowski
>
>
>
This seems to be deliberate - see the first item under "Possible Issues"
in the help for Chop.
David Bailey
http://www.dbaileyconsultancy.co.uk
I get the same behavior on Windows 7 for 7.0.1 and 8.0.1.
Did notice the documentation on Chop in 8.0.1 includes a new
subsection on 'possible issues'... Seems like there should be some
type of 'show changes' indicator in the documentation.
-------
>From the new subsection on possible issues:
Machine complex numbers have machine reals for both real and imaginary
parts:
In[1]:= 2. I
Out[1]= 0. + 2. I
Consequently, Chop does not make the real part of machine complex
numbers an exact zero:
In[2]:= Chop[10.^-12 + 2. I]
Out[2]= 0. + 2. I
Small imaginary parts from machine complex numbers are eliminated to
make a machine real:
In[3]:= Chop[2. + 10.^-12 I]
Out[3]= 2.
-----
It seems to me that 8.0.1 is the more desired behavior, no? (Maintains
precision; one can use Re or Im to select parts that remain, right?)
-RG
On 3/21/2011 7:18 AM, Andrzej Kozlowski wrote:
> Chop does not seem to work properly in Mathematica 8.0.1:
>
> f[a_] := 2 I Pi Sin[a]/a
>
> In[2]:= f[1.]
>
> Out[2]= 0. + 5.287118128162912*I
>
> In[3]:= Chop[%]
>
> Out[3]= 0. + 5.287118128162912*I
>
> This is with
>
> In[4]:= $Version
>
> Out[4]= 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
>
> Mathematica 7.01 returns 5.287118128162912*I as expected.
>
> Can anyone confirm it? At the moment I can't see any simple work around...
>
> Andrzej Kozlowski
>
--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
$Version
"8.0 for Mac OS X x86 (64-bit) (February 23, 2011)"
f[a_] := 2 I Pi Sin[a]/a
f[1.] // Chop
0. + 5.287118128162912*I
Bob Hanlon
---- Andrzej Kozlowski <ak...@mimuw.edu.pl> wrote:
=============
No,
fortunately it returns 0. + 1.1*I ;-)
--V
Hi. I don't have a solution to the question, but this may work better at 0.
g[a_]:=2 I Pi Sinc[a]
g[0.]
0.\[VeryThinSpace]+6.283 I
vs. Power::infy:
f[0.]
Power::infy: Infinite expression 1/0. encountered.
= = = = = = = = = =
HTH : >)
Dana DeLouis
>
> On 22 Mar 2011, at 11:09, telefunkenvf14 wrote:
>
>> On Mar 21, 6:18 am, Andrzej Kozlowski <a...@mimuw.edu.pl> wrote:
>>> Chop does not seem to work properly in Mathematica 8.0.1:
>>>
>>> f[a_] := 2 I Pi Sin[a]/a
>>>
>>> In[2]:= f[1.]
>>>
>>> Out[2]= 0. + 5.287118128162912*I
>>>
>>> In[3]:= Chop[%]
>>>
>>> Out[3]= 0. + 5.287118128162912*I
>>>
>>> This is with
>>>
>>> In[4]:= $Version
>>>
>>> Out[4]= 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
>>>
>>> Mathematica 7.01 returns 5.287118128162912*I as expected.
>>>
>>> Can anyone confirm it? At the moment I can't see any simple work around.. .
>>>
>>> Andrzej Kozlowski
>>
>> I get the same behavior on Windows 7 for 7.0.1 and 8.0.1.
>>
>> Did notice the documentation on Chop in 8.0.1 includes a new
>> subsection on 'possible issues'... Seems like there should be some
>> type of 'show changes' indicator in the documentation.
>>
>> -------
>>> From the new subsection on possible issues:
>>
>> Machine complex numbers have machine reals for both real and imaginary
>> parts:
>>
>> In[1]:= 2. I
>> Out[1]= 0. + 2. I
>>
>> Consequently, Chop does not make the real part of machine complex
>> numbers an exact zero:
>>
>> In[2]:= Chop[10.^-12 + 2. I]
>> Out[2]= 0. + 2. I
>>
>> Small imaginary parts from machine complex numbers are eliminated to
>> make a machine real:
>>
>> In[3]:= Chop[2. + 10.^-12 I]
>> Out[3]= 2.
>>
>> -----
>>
>> It seems to me that 8.0.1 is the more desired behavior, no? (Maintains
>> precision; one can use Re or Im to select parts that remain, right?)
>>
>> -RG
>>
>
> I agree, except for one little thing. I don't see any advantage in the approximate zero real part of a machine complex number being *displayed*. It is certainly possible to change that (MakeBoxes can be used for this purpose) and it just isn't consistent with the traditional practice in mathematics. And, after all, isn't this what TraditionalForm is supposed to be for?
>
> Andrzej
I have to send a correction to the above. It is indeed possible to "fix" the above problem using MakeBoxes and get back the display of machine complex numbers in previous versions, but doing so can have disastrous consequences for Dynamic programs that make use of machine precision complex numbers (as I have just discovered). So it's not a good idea for users to attempt to "fix" such things themselves.
As for me, I can live with this, although it does look odd, especially to mathematicians not used to the quirky ways of mathematical software.
Andrzej Kozlowski
> On Mar 21, 6:18 am, Andrzej Kozlowski <a...@mimuw.edu.pl> wrote:
>> Chop does not seem to work properly in Mathematica 8.0.1:
>>
>> f[a_] := 2 I Pi Sin[a]/a
>>
>> In[2]:= f[1.]
>>
>> Out[2]= 0. + 5.287118128162912*I
>>
>> In[3]:= Chop[%]
>>
>> Out[3]= 0. + 5.287118128162912*I
>>
>> This is with
>>
>> In[4]:= $Version
>>
>> Out[4]= 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
>>
>> Mathematica 7.01 returns 5.287118128162912*I as expected.
>>
>> Can anyone confirm it? At the moment I can't see any simple work around. . .
Heike
On 21 Mar 2011, at 11:12, Andrzej Kozlowski wrote:
> Hmm... perhaps this is not a bug but a deliberate new design?
>
> Just evaluating
>
> 1.1 I
>
> returns
>
> 0. +1.1
>
> It seems a purely cosmetic issue but it does look a rather
> "untraditional". Can anyone confirm that this is indeed an intentional
> change?
>
> Andrzej Kozlowski
>
>
>
On 3/23/2011 3:56 AM, Andrzej Kozlowski wrote:
> On 22 Mar 2011, at 11:09, telefunkenvf14 wrote:
>
>> On Mar 21, 6:18 am, Andrzej Kozlowski<a...@mimuw.edu.pl> wrote:
>>> Chop does not seem to work properly in Mathematica 8.0.1:
>>>
>>> f[a_] := 2 I Pi Sin[a]/a
>>>
>>> In[2]:= f[1.]
>>>
>>> Out[2]= 0. + 5.287118128162912*I
>>>
>>> In[3]:= Chop[%]
>>>
>>> Out[3]= 0. + 5.287118128162912*I
>>>
>>> This is with
>>>
>>> In[4]:= $Version
>>>
>>> Out[4]= 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
>>>
>>> Mathematica 7.01 returns 5.287118128162912*I as expected.
>>>
>>> Can anyone confirm it? At the moment I can't see any simple work around. . .
>>>
>>> Andrzej Kozlowski
>>
>> I get the same behavior on Windows 7 for 7.0.1 and 8.0.1.
>>
>> Did notice the documentation on Chop in 8.0.1 includes a new
>> subsection on 'possible issues'... Seems like there should be some
>> type of 'show changes' indicator in the documentation.
>>
>> -------
>>> From the new subsection on possible issues:
>>
>> Machine complex numbers have machine reals for both real and imaginary
>> parts:
>>
>> In[1]:= 2. I
>> Out[1]= 0. + 2. I
>>
>> Consequently, Chop does not make the real part of machine complex
>> numbers an exact zero:
>>
>> In[2]:= Chop[10.^-12 + 2. I]
>> Out[2]= 0. + 2. I
>>
>> Small imaginary parts from machine complex numbers are eliminated to
>> make a machine real:
>>
>> In[3]:= Chop[2. + 10.^-12 I]
>> Out[3]= 2.
>>
>> -----
>>
>> It seems to me that 8.0.1 is the more desired behavior, no? (Maintains
>> precision; one can use Re or Im to select parts that remain, right?)
>>
>> -RG
>>
>
> I agree, except for one little thing. I don't see any advantage in the approximate zero real part of a machine complex number being *displayed*. It is certainly possible to change that (MakeBoxes can be used for this purpose) and it just isn't consistent with the traditional practice in mathematics. And, after all, isn't this what TraditionalForm is supposed to be for?
>
> Andrzej
>
--
When I write 1.1 I, I do NOT imply that the real part is also approximate.
Bobby
On Wed, 23 Mar 2011 02:52:06 -0500, Heike Gramberg
<heike.g...@gmail.com> wrote:
> In the "Possible Issues" section in the documentation of Chop it says
> that
> "Machine complex numbers have machine reals for both real and imaginary
> parts", and that "Consequently, Chop does not make the real part of
> machine complex numbers an exact zero", so I guess it's intentional.
>
> Heike
>
> On 21 Mar 2011, at 11:12, Andrzej Kozlowski wrote:
>
>> Hmm... perhaps this is not a bug but a deliberate new design?
>>
>> Just evaluating
>>
>> 1.1 I
>>
>> returns
>>
>> 0. +1.1
>>
>> It seems a purely cosmetic issue but it does look a rather
>> "untraditional". Can anyone confirm that this is indeed an intentional
>> change?
>>
>> Andrzej Kozlowski
>>
>>
>>
>> On 20 Mar 2011, at 12:44, Andrzej Kozlowski wrote:
>>
>>> Chop does not seem to work properly in Mathematica 8.0.1:
>>>
>>> f[a_] := 2 I Pi Sin[a]/a
>>>
>>> In[2]:= f[1.]
>>>
>>> Out[2]= 0. + 5.287118128162912*I
>>>
>>> In[3]:= Chop[%]
>>>
>>> Out[3]= 0. + 5.287118128162912*I
>>>
>>> This is with
>>>
>>> In[4]:= $Version
>>>
>>> Out[4]= 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
>>>
>>> Mathematica 7.01 returns 5.287118128162912*I as expected.
>>>
>>> Can anyone confirm it? At the moment I can't see any simple work
>> around...
>>>
>>> Andrzej Kozlowski
>>
>>
>