[vlc-devel] [PATCH 17/22] vlc_arrays: DictHash output is always used as an int

Filipe Cabecinhas filcab at filcab.net
Sun Aug 2 21:24:54 CEST 2015


On Sunday, August 2, 2015, Rémi Denis-Courmont <remi at remlab.net> wrote:

> Le dimanche 02 août 2015, 12:07:49 Filipe Cabecinhas a écrit :
> > >> Not losing precision.
> > >
> > > What the heck does that even mean? Neither converting implicitly nor
> > > casting explicitly to int (or any other signed type) can lose
> precision.
> >
> > How are you not losing precision? You had a 64-bit integer and are
> getting
> > the bottom 32 bits.
>
> Of course not. Conversion from an integer type to a *signed* integer type
> is
> always exact in C. The number of bits of both types is irrelevant.

It's implementation dependent but exact, yes. What I'm saying is that int
might be 32 bits and you might only get the bottom 32 bits of the uint64_t
you had. I'm not saying you could get different results from the same input
or anything similar. Just that you're discarding some bits if int is 32
bits.

  Filipe



>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150802/1850634f/attachment.html>


More information about the vlc-devel mailing list