MATLAB BUILDER JA 2 Guia do Utilizador Página 150

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 292
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 291 292

Comentários a estes Manuais

Sem comentários