MATLAB BUILDER JA 2 Uživatelská příručka Strana 150

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 292
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 291 292

Komentáře k této Příručce

Žádné komentáře