1
$\begingroup$

I have entered the following code from the ND documentation, and get the wrong answer.

Needs["NumericalCalculus`"];
ND[Exp[x],x,1]
(*--> 0. *)

(The correct answer should be $e^1=2.71828$.) When I hover over ND, I get a warning saying "ND occurs in more than one context". However, it seems like NumericalCalculus is first in the context path, and therefore I am indeed using the ND defined in the NumericalCalculus package.

$ContextPath
(*--->{NumericalCalculus`,SVTools`,DocumentationSearch`,ResourceLocator`,URLUtilities`,PacletManager`,System`,Global`})

Context[ND]
(*---> NumericalCalculus`)

So what the heck is going on?

$\endgroup$
3
  • $\begingroup$ Evaluating your code with a clean notebook in a new V12.0 session running on Mac OS 10.13, I get the expected answer. I can only conclude there is something has been corrupted in your Mathematica session. $\endgroup$
    – m_goldberg
    Mar 3 '20 at 17:09
  • 4
    $\begingroup$ I'm voting to close this question as off-topic because I can not reproduce the problem the OP is experiencing; I suspect it is being caused by corrupted lexical elements in the OP's Mathematica notebook. $\endgroup$
    – m_goldberg
    Mar 3 '20 at 17:11
  • $\begingroup$ @m_goldberg Well, to be honest that's an alright answer already. At least I understand the nature of my problem a little better now. $\endgroup$ Mar 3 '20 at 19:43