/Advanced Level/Numerical Analysis/

From Script | Spoken-Tutorial
Revision as of 16:02, 24 December 2012 by Gyan (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The set of numbers in Scilab can be extended by adding %inf (infinity) and %nan (not a number). This is done with the Scilab function ieee:


 -->ieee()                   
 ans =0.

We see the default floating-point exception mode to be zero


   -->1/0                    
 !--error 27
 
 division by zero...
 

Let us now use the standard ieee floating-point exception mode:

 -->ieee(2)
 
 -->1/0                    
 
 ans =
 
 Inf

In this mode, 1/0 evaluates to infinity.

 -->0/0                     
 
 ans =
 
 Nan
 

In this mode, 0/0 also is handled gracefully.

Contributors and Content Editors

Gyan