Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский
Scilab Help >> Elementary Functions > Floating point > isinf

isinf

tests for infinite elements

Syntax

r = isinf(x)

Arguments

x

matrix of real or complex numbers, or of polynomials with real or complex coefficients.

r

matrix of booleans of the same size as x.

Description

x are real or complex numbers: r = isinf(x) returns the matrix r of booleans such that r(i) is %T if abs(x(i)) is infinite, and %F otherwise.

x are polynomials with real or complex coefficients: Then after r = isinf(x), r(i) is %T if at least one of the x(i) coefficients is infinite, and %F otherwise.

Examples

With real and complex numbers:

[i, inf, nan] = (%i, %inf, %nan);
isinf([-1  0.01 -inf  inf  nan])
isinf([2+i, -10-inf, inf+i])
isinf([nan-i, nan+i*inf])
isinf(inf-nan*i)
--> isinf([-1  0.01 -inf  inf  nan])
 ans  =
  F F T T F

--> isinf([2+i, -10-inf, inf+i])
 ans  =
  F T T

--> isinf([nan-i, nan+i*inf])
 ans  =
  F T

--> isinf(inf-nan*i)
 ans  =
  F
Please note that %inf-%nan*%i is computed as %inf - %nan*complex(0,1) == %inf - complex(%nan*0, %nan*1) == %inf - complex(%nan, %nan) == complex(%inf-%nan, -%nan) == complex(%nan, %nan) , where Inf is eaten by Nan and no longer appears.

With polynomials :

p = poly([%nan -2 0 3],"x","coeff")
q = poly([0 %inf %i],"x","coeff")
r = poly([%nan %inf*%i 1],"x","coeff")
isinf([p q r])
--> p = poly([%nan -2 0 3],"x","coeff")
 p  =
  Nan -2x +3x³

--> q = poly([0 %inf %i],"x","coeff")
 q  =
  Infx +ix²

--> r = poly([%nan %inf*%i 1],"x","coeff")
 r  =
  Nan -(Nan-Infi)x +x²

--> isinf([p q r])
 ans  =
  F T F

See also

  • percentinf — infinity
  • isnan — check for "Not a Number" entries
  • isreal — check if a variable is stored as a complex matrix
  • isnum — tests if a string represents a number
  • type — returns the type of a Scilab object

History

VersionDescription
6.1.0 Extension to polynomials.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:49:19 CET 2020