MagicPlot Manual

Plotting and nonlinear fitting software

User Tools

Site Tools


nan

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
nan [Thu Jan 14 18:24:11 2010]
Gray
nan [Sun Nov 8 12:21:24 2015]
127.0.0.1 external edit
Line 1: Line 1:
-====== NaN ====== +====== Missing Values (NaN) in Tables and Calculations ====== 
-In computing, NaN, which stands for Not a Number, is a value or symbol that is usually produced as the result of an operation on invalid input operands. For example, most floating-point units are unable to explicitly calculate the square root of negative numbers, and will instead indicate that the operation was invalid and return a NaN result.+In computing, NaN, which stands for Not a Number, is a value or symbol that is usually produced as result of an operation on invalid input operands. For example, most floating-point units are unable to explicitly calculate the square root of negative numbers, and will instead indicate that the operation was invalid and return a NaN result.
  
-An invalid operation is not the same as an arithmetic overflow (which returns a positive or negative infinity). Arithmetic operations involving NaN always produce NaN, allowing the value to propagate through a calculation so that errors can be detected at the end without extensive testing during intermediate stages.+An invalid operation is not the same as an arithmetic overflow (which returns a positive or negative infinity). Arithmetic operations involving NaN always produce NaN, allowing the value to propagate through a calculation so that errors can be detected at the end without extensive testing during intermediate stages. A NaN does not compare equal to any number or NaN.
  
-A NaN does not compare equal to any number or NaN. You can therefore test whether a variable has a NaN value by comparing it to itself, thus if ''== x'' gives false (0) then x is a NaN code.+==== How does a NaN appear? ====
  
-==== How NaN appears? ==== +There are three kinds of operations which return NaN:
- +
-There are three kinds of operation which return NaN:+
   - Operations with a NaN as at least one operand, e.g. ''1+NaN''   - Operations with a NaN as at least one operand, e.g. ''1+NaN''
   - Indeterminate forms   - Indeterminate forms
-      * The divisions ''0/0, ∞/∞, ∞/-∞, -∞/∞, -∞/-∞'' +      * Divisions ''0/0, ∞/∞, ∞/-∞, -∞/∞, -∞/-∞'' 
-      * The multiplications ''0*∞, 0*(-∞)'' +      * Multiplications ''0*∞, 0*(-∞)'' 
-      * The power ''1^∞'' +      * Power ''1^∞'' 
-      * The additions ''∞+(-∞), (-∞)+∞'' and equivalent subtractions.+      * Additions ''∞+(-∞), (-∞)+∞'' and equivalent subtractions.
   - Real operations with complex results   - Real operations with complex results
-      * The square root of a negative number +      * Square root of a negative number 
-      * The logarithm of a negative number +      * Logarithm of a negative number 
-      * The tangent of an odd multiple of 90 degrees (or //π///2 radians) +      * Tangent of an odd multiple of 90 degrees (or //π///2 radians) 
-      * The inverse sine or cosine of a number which is less than -1 or greater than +1.+      * Inverse sine or cosine of a number which is less than -1 or greater than +1.
  
 === Examples === === Examples ===
Line 30: Line 28:
  
 ===== NaN in MagicPlot Tables ===== ===== NaN in MagicPlot Tables =====
-In MagicPlot NaN also is used to represent empty cells in [[table|Tables]].+In MagicPlot NaN is also used to represent empty cells in [[table|Tables]].
  
 Statistical functions ignore NaN values in Tables. Statistical functions ignore NaN values in Tables.
Line 38: Line 36:
  
 === Example === === Example ===
-  * ''if(col(B) >= 0, col(B), NaN)'' – returns only positive values from column B. Negative values are replaced by NaN value. You can use this expression to filter negative values if you do not want to use them in future calculations. Notethat //”Not-a-Number returned at row #”// warning can be shown for such expression.+  * If you set a [[set_column_formula|Column Formula]] ''if(col(B) >= 0, col(B), NaN)'', it will return only positive values from column B. Negative values are replaced with NaN value. You can use this expression to filter negative values if you do not want to use them in future calculations. Note that //”Not-a-Number returned at row #”// warning can be shown for such expressions.
nan.txt · Last modified: Sat Jan 16 20:07:19 2021 by Alexander