MATLAB BUILDER JA 2 Podręcznik Użytkownika Strona 150

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag