MATLAB BUILDER JA 2 Guide de l'utilisateur Page 150

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 292
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 149
4 Using MWArra y Classes
Test x for infin ity:
double x = 1.0 / 0.0;
if (MWNumericArray.isInf(x))
System.out.println("The input value is infinite");
When run, the example displays this output:
The input value is infinite
isNaN. This method tests for NaN (Not a Number) in a machine-independent
manner. This is a static method of the class and does not need to be invoked
in reference to an instance of the class.
The prototype for the
isNaN method is
public static boolean isNaN(double value)
Input Parameters
value
double
value to test for NaN
Example Testing for NaN Array Values
Test x for NaN:
double x = 0.0 / 0.0;
if (MWNumericArray.isNaN(x))
System.out.println("The input value is not a number.");
When run, the example displays this output:
The input value is not a number.
4-74
Vue de la page 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 291 292

Commentaires sur ces manuels

Pas de commentaire