Difference between revisions of "/Advanced Level/Numerical Analysis/"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with '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() an…')
 
(No difference)

Latest revision as of 16:02, 24 December 2012

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