Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.2K Views
|
9 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Unexpected behavior from Arg in v13.3

POSTED BY: Martijn Froeling
9 Replies
POSTED BY: Martijn Froeling

I am working with version 13.3 on a Mac. The command c = Unitize[arg] gives a list of zeros every time I try it.

POSTED BY: Gianluca Gorni

Martijn, I doubt there is anything I can change about this, but I’ll take a look because it does seem suspicious. Your explanation in this recent response, and isolation of clear examples, is a big help.

POSTED BY: Daniel Lichtblau

Thanks Daniel! For now i know the reason why my code changed outputs and i have a fix for it which works in all versions and i learned some things on the way so I'm happy for now.

POSTED BY: Martijn Froeling
POSTED BY: Daniel Lichtblau
Posted 2 years ago

Can you check mine too? I recently downloaded 13.3 on my Debian linux and checked there is the same issue as in cloud.

POSTED BY: ZAQU zaqu
Posted 2 years ago

The C99 complex.h requires a separate implementation, that is in glibc and Intel libm, even less accurate than real numbers math.h glibc and Microsoft math library. Mathematica did not bother, it just uses naive implementation for complex multiplication. In practice the code using glibc is less accurate than from Windows:

https://community.wolfram.com/groups/-/m/t/2851685

POSTED BY: ZAQU zaqu

The idea behind having 0*0.0 evaluate to 0.0 is to maintain the type rule int times real equal real. One can question this of course. But it has advantages particularly for type consistency and inferencing, as is needed in Compile and the newer FunctionCompile world.

POSTED BY: Daniel Lichtblau

From the documentation on Numbers:

Whenever you give a number with an explicit decimal point, the Wolfram Language produces an approximate numerical result

Here is what happens by multiplying an approximate number by the exact zero:

In[2]:= 0*0.

Out[2]= 0.
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard