Main Content

isdouble

Determine whether input is double-precision data type

Description

example

tf = isdouble(a) returns 1 (true) when the DataType property of fi object a is double. Otherwise, it returns 0 (false).

example

tf = isdouble(T) returns 1 (true) when the DataType property of numerictype object T is double. Otherwise, it returns 0 (false).

Examples

collapse all

Create a fi object and determine if its data type is double.

a = fi(pi)
a = 
    3.1416

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 13
tf = isdouble(a)
tf = logical
   0

a = fi(pi,'DataType','double')
a = 
    3.1416

          DataTypeMode: Double
tf = isdouble(a)
tf = logical
   1

Create a numerictype object and determine if its data type is double.

T = numerictype
T =


          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 15
tf = isdouble(T)
tf = logical
   0

T = numerictype('Double')
T =


          DataTypeMode: Double
tf = isdouble(T)
tf = logical
   1

Input Arguments

collapse all

Input fi object, specified as a scalar, vector, matrix, or multidimensional array.

Data Types: fi

Input numerictype object, specified as a scalar.

Version History

Introduced in R2008a