Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14877 > unrolled thread

Multiplication by 0: non-zero in versions 8 and 9

Started bySotirios Bonanos <sbonano@inp.demokritos.gr>
First post2013-06-15 08:16 +0000
Last post2013-06-17 10:20 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Multiplication by 0: non-zero in versions 8 and 9 Sotirios Bonanos <sbonano@inp.demokritos.gr> - 2013-06-15 08:16 +0000
    Re: Multiplication by 0: non-zero in versions 8 and 9 Richard Fateman <fateman@cs.berkeley.edu> - 2013-06-16 09:09 +0000
    Re: Multiplication by 0: non-zero in versions 8 and 9 Daniel Lichtblau <danl@wolfram.com> - 2013-06-17 10:20 +0000

#14877 — Multiplication by 0: non-zero in versions 8 and 9

FromSotirios Bonanos <sbonano@inp.demokritos.gr>
Date2013-06-15 08:16 +0000
SubjectMultiplication by 0: non-zero in versions 8 and 9
Message-ID<kph7t1$2es$1@smc.vnet.net>
Hello , 

I have noticed that in all Mathematica versions <8, multiplying a real or complex number by the integer 0 gives 0, but in versions 8 and 9 

Times[0, 0.567] gives 0. 

and 

Times[1.23 + I 2.45, 0] gives 0. + 0. I 

I don't know what prompted this change but it is definitely wrong: the zero property of multiplication holds for real and complex numbers also (see https://en.wikipedia.org/wiki/Multiplication#Properties) . 

Sotirios Bonanos 
http://www.inp.demokritos.gr/~sbonano/ 

[toc] | [next] | [standalone]


#14901

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2013-06-16 09:09 +0000
Message-ID<kpjvcj$9me$1@smc.vnet.net>
In reply to#14877
On 6/15/2013 1:16 AM, Sotirios Bonanos wrote:
> Hello ,
>
> I have noticed that in all Mathematica versions <8, multiplying a
> real or complex number by the integer 0 gives 0, but in versions 8
> and 9
>
> Times[0, 0.567] gives 0.
>
> and
>
> Times[1.23 + I 2.45, 0] gives 0. + 0. I
>
> I don't know what prompted this change but it is definitely wrong:
> the zero property of multiplication holds for real and complex
> numbers also (see
> https://en.wikipedia.org/wiki/Multiplication#Properties) .
>
> Sotirios Bonanos http://www.inp.demokritos.gr/~sbonano/
>
>

You appear to be making a distinction between "0"  and "0."
and "0.+0.I".  Yet for Mathematica,  0==0.+0.*I  returns True.

You may have a valid objection to something that has been
changed in the program, but appealing to the wikipedia
article is not particularly significant.

After all,
Times[0,x]  comes out as 0,  but this is not what happens
for x being 0., Indeterminate, Infinity, Interval[{-1,1}],
and probably other stuff.

As Dorothy said, you are not in Kansas anymore.
http://en.wiktionary.org/wiki/not_in_Kansas_anymore

[toc] | [prev] | [next] | [standalone]


#14923

FromDaniel Lichtblau <danl@wolfram.com>
Date2013-06-17 10:20 +0000
Message-ID<kpmnu5$h5b$1@smc.vnet.net>
In reply to#14877
On Jun 15, 3:16 am, Sotirios Bonanos <sbon...@inp.demokritos.gr>
wrote:
> Hello ,
>
> I have noticed that in all Mathematica versions <8, multiplying a real or complex number by the integer 0 gives 0, but in versions 8 and 9
>
> Times[0, 0.567] gives 0.
>
> and
>
> Times[1.23 + I 2.45, 0] gives 0. + 0. I
>
> I don't know what prompted this change but it is definitely wrong: the zero property of multiplication holds for real and complex numbers also (see https://en.wikipedia.org/wiki/Multiplication#Properties) .
>
> Sotirios Bonanoshttp://www.inp.demokritos.gr/~sbonano/

This is a sort of edge case. It is important (especially in say
matrix algebra) to have machine reals and complexes remain in that
class. Hence the importance of this change which, I agree, can be
disconcerting. But it allows the possibility to avoid unpacking
packed arrays just to handle some elements that have become
exact zeros.

In contrast, higher precision arithmetic behaves as you would expect.

In[7]:= 0*N[1, 20]

Out[7]= 0

What this is, really, is a balancing act in terms of maintaining type
(exact vs approximate), respecting the math (where exact zero times
most things usually does give exact zero), and not doing things that
would needlessly have a bad impact on speed and memory consumption.

Daniel Lichtblau
Wolfram Research

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web