octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uint64_t usage


From: Rik
Subject: Re: uint64_t usage
Date: Tue, 6 Oct 2015 12:47:52 -0700

On 10/06/2015 11:37 AM, Mike Miller wrote:
> On Tue, Oct 6, 2015 at 11:04:37 -0700, Rik wrote:
>> After including "stdint.h", can I always rely on uint64_t being available
>> to the compiler?  Or do I need to write complicated code with #ifdefs to
>> use either uint32_t or uint64_t?
> No, it is not guaranteed. My reading of gnulib's stdint.h (which we
> are using) is that it will define the macros GL_INT64_T and
> GL_UINT64_T if the corresponding 64-bit integer types are available.
Thanks to your second e-mail, and some grepping in the code, I see that we
do assume that uint64_t exists unconditionally.  I'm going to do the same
thing.  If we later need to fix this then we can fix it everywhere in the code.

>> We could also have Octave only support 32-bit binary constants since I
>> think uint32_t is guaranteed.
> I would like to see 64-bit values supported. Do you intend to return
> the value as a uint64 to the interpreter? Or will it be returned as a
> double, hence lose precision (as we do currently with 0x integer
> constants, something I'd also like to fix)?
>
I'm going to work in stages.  The first goal is just to get an
implementation into the core; After that, it can be improved.

Stage 1 will just convert to double so any constant greater than 2^53 will
lose precision.  But I too would like to see support for larger constants. 
There is a feature request for longer integer constants in combination with
uint64 here (https://savannah.gnu.org/bugs/?45945).

--Rik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]