From help-octave-request at bevo dot che dot wisc dot edu Wed Jan 7 16:09:50 2004 Subject: oct and inegers From: "John W. Eaton" To: Claudio Belotti Cc: help-octave at bevo dot che dot wisc dot edu Date: Wed, 7 Jan 2004 16:09:39 -0600 On 7-Jan-2004, Claudio Belotti wrote: | I have an oct functions reading some files and returning data to | octave (some of the values are integers, int32_t) after some | operations I send the data back to the oct function; is there a way | to understand if an octave_value is an integer or a double? Unless you are using some add-on package that provides a special integer data type, all numbers in Octave are stored internally as double precision floating point values. So you have to do something like if (round (x) == x) or, in a C++ file, I typically use if (NINT (x) == x) (NINT is a macro defined in liboctave/lo-utils.h). jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------