Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

# 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

 Version Description 6.1.0 Extension to polynomials.
 Report an issue << int Floating point isnan >>

 Copyright (c) 2022-2024 (Dassault Systèmes)Copyright (c) 2017-2022 (ESI Group)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