As part of a hdf5 related project, I have tried to initialize some int64 variables (hdf5’s `hid_t`

), in C++ or in m-code, and pass them back en forth between C++ functions and the m_code interpreter. The issue is that when numbers are larger than what `double`

can reliably store, the variables get messed up.

I don’t know if I am doing something wrong, if there is an intrinsic limitation to this approach, or if there is a bug.

I defined a `ping_int64`

function, that just tries to return the original int64 variable. Here is the definition:

```
#include <octave/oct.h>
DEFUN_DLD(ping_int64, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {} {@var{out} =} ping_int64 (@var{in})\n\
@seealso{}\n\
@end deftypefn")
{
octave_value_list retval;
int nargin = args.length ();
if (nargin != 1)
print_usage ();
int64_t out = args(0).xint64_value ("IN should be a scalar int64 val");
return retval.append (octave_int64 (out));
}
```

Here is what I observe:

```
octave:2> a = intmax ("int64")
a = 9223372036854775807
octave:3> b = ping_int64 (a)
b = -9223372036854775808
```

Any hint would be appreciated.