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


Groups > comp.soft-sys.math.mathematica > #14923

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

From Daniel Lichtblau <danl@wolfram.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Multiplication by 0: non-zero in versions 8 and 9
Date 2013-06-17 10:20 +0000
Message-ID <kpmnu5$h5b$1@smc.vnet.net> (permalink)
References <kph7t1$2es$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

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

csiph-web