Difference between revisions of "Error Messages/40062"

(Created page with "== Warning messages == :Logarithm of a non-positive number. :Sqrt of a non-positive number. == Description == The logarithm or square root of a non-positive number is not d...")
 
m
 
Line 2: Line 2:
  
 
:Logarithm of a non-positive number.
 
:Logarithm of a non-positive number.
:Sqrt of a non-positive number.
 
  
 
== Description ==
 
== Description ==
  
The logarithm or square root of a non-positive number is not defined on the reals. It is possible to take the logarithm or square root of a negative number if you want a complex number for the result. If you want to manipulate complex numbers, set the system variable [[EnableComplexNumbers]] to 1, and then this warning won't occur. If you aren't working with complex numbers, this probably indicates a mistake in your model logic.
+
The logarithm of a non-positive number is not defined on the reals. It is possible to take the logarithm of a negative number if you want a complex number for the result. If you want to manipulate complex numbers, set the system variable [[EnableComplexNumbers]] to 1, and then this warning won't occur. If you aren't working with complex numbers, this probably indicates a mistake in your model logic.
  
 
To avoid the warning, you can either use, e.g.,
 
To avoid the warning, you can either use, e.g.,

Latest revision as of 20:39, 19 January 2018

Warning messages

Logarithm of a non-positive number.

Description

The logarithm of a non-positive number is not defined on the reals. It is possible to take the logarithm of a negative number if you want a complex number for the result. If you want to manipulate complex numbers, set the system variable EnableComplexNumbers to 1, and then this warning won't occur. If you aren't working with complex numbers, this probably indicates a mistake in your model logic.

To avoid the warning, you can either use, e.g.,

If x>0 Then Ln(x) Else Null

or

IgnoreWarnings( Ln(x) )

In the second case, the result will be NaN.

See Also

Comments


You are not allowed to post comments.