Inadmissible data type or value. overflow.

asked 2019-09-06 18:25:17 +0200

JackZed gravatar image
Function Derivative(optional x,optional n)  
    dim d as double     
    if (x = 0 and (n = 0 or n = 1)) then
        stop
    end if
    d = n*x^(n-1) 
    Derivative = d
End Function
edit retag flag offensive close merge delete

Comments

It's almost worthless without showing how you call that function. No way to figure out what's wrong with your call of the function. For me e.g. =DERIVATIVE(4,2) works an shows the correct value of the derivative of the quadratic function at x=4.

Opaque gravatar imageOpaque ( 2019-09-06 18:41:55 +0200 )edit