Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.6K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

User-defined assignment is ignored in large Table[ ] computation

Posted 4 years ago
POSTED BY: Martin Guttmann
3 Replies
Posted 4 years ago

That is certainly a much safer operation because the definition is associated with f, not Abs. For more details take a look at this and this.

POSTED BY: Rohit Namjoshi
POSTED BY: Martin Guttmann
Posted 4 years ago

Hi Martin

Compare

Table[Abs[i], {i, 249}] // Trace
Table[Abs[i], {i, 250}] // Trace

When the upper bound exceeds 249 Table probably uses a version of Abs that is internal and optimized for long lists.

Lesson: Modifying built-in functions is risky and unpredictable.

What problem are you trying to solve? Perhaps there is a better solution for it rather than this example.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard