L
Luna Moon
Hi all,
I am translating a Matlab program into C/C++.
Here is one function in Matlab that I am having difficulty with
translating:
isfinite(x)
Here are the documents:
What are the equivalent statement in C/C++? Basically I am trying to
handle the non-finite numbers or invalid numbers in C/C++ in a nice
way...
Thanks!
--------------------------------------------
K>> help isfinite
ISFINITE True for finite elements.
ISFINITE(X) returns an array that contains 1's where
the elements of X are finite and 0's where they are not.
For example, ISFINITE([pi NaN Inf -Inf]) is [1 0 0 0].
For any X, exactly one of ISFINITE(X), ISINF(X), or ISNAN(X)
is 1 for each element.
See also isnan, isinf.
Reference page in Help browser
doc isfinite
K>> help isnan
ISNAN True for Not-a-Number.
ISNAN(X) returns an array that contains 1's where
the elements of X are NaN's and 0's where they are not.
For example, ISNAN([pi NaN Inf -Inf]) is [0 1 0 0].
See also isfinite, isinf.
Reference page in Help browser
doc isnan
K>> help isinf
ISINF True for infinite elements.
ISINF(X) returns an array that contains 1's where the
elements of X are +Inf or -Inf and 0's where they are not.
For example, ISINF([pi NaN Inf -Inf]) is [0 0 1 1].
See also isfinite, isnan.
Reference page in Help browser
doc isinf
I am translating a Matlab program into C/C++.
Here is one function in Matlab that I am having difficulty with
translating:
isfinite(x)
Here are the documents:
What are the equivalent statement in C/C++? Basically I am trying to
handle the non-finite numbers or invalid numbers in C/C++ in a nice
way...
Thanks!
--------------------------------------------
K>> help isfinite
ISFINITE True for finite elements.
ISFINITE(X) returns an array that contains 1's where
the elements of X are finite and 0's where they are not.
For example, ISFINITE([pi NaN Inf -Inf]) is [1 0 0 0].
For any X, exactly one of ISFINITE(X), ISINF(X), or ISNAN(X)
is 1 for each element.
See also isnan, isinf.
Reference page in Help browser
doc isfinite
K>> help isnan
ISNAN True for Not-a-Number.
ISNAN(X) returns an array that contains 1's where
the elements of X are NaN's and 0's where they are not.
For example, ISNAN([pi NaN Inf -Inf]) is [0 1 0 0].
See also isfinite, isinf.
Reference page in Help browser
doc isnan
K>> help isinf
ISINF True for infinite elements.
ISINF(X) returns an array that contains 1's where the
elements of X are +Inf or -Inf and 0's where they are not.
For example, ISINF([pi NaN Inf -Inf]) is [0 0 1 1].
See also isfinite, isnan.
Reference page in Help browser
doc isinf