<< apifun_checkcomplex Check content apifun_checkgreq >>

Apifun >> Apifun > Check content > apifun_checkflint

apifun_checkflint

Generates an error if the variable is not a floating point integer.

Calling Sequence

errmsg=apifun_checkflint(funname,var,varname,ivar)

Parameters

funname :

a 1-by-1 matrix of strings, the name of the calling function.

var :

a matrix of valid Scilab data type, the variable

varname :

a 1-by-1 matrix of string, the name of the variable

ivar :

a 1-by-1 matrix of floating point integers, the index of the input argument in the calling sequence

errmsg :

a 1-by-1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.

Description

Checks that the variable var is a "constant" and that its content is an integer (i.e. the value has no fractional part). This is checked with the condition and(round(x)==x).

Examples

// The function takes an argument x which is a double
// with an integer value
function y=myfunction(x)
apifun_checkflint ( "myfunction",x,"x",1 )
y = x.^2
endfunction
// Calling sequences which work
myfunction ( [-1 -2 12] )
// Calling sequences which generate an error
myfunction ( [1.5 1] )

Authors


<< apifun_checkcomplex Check content apifun_checkgreq >>