[Scilab-users] Bitget for int64/uint64

Samuel Gougeon sgougeon at free.fr
Thu Feb 27 18:51:21 CET 2020


With the current implementation, you will get the right result with the 
following:

bitget([b b], uint64(1:64))(1,:)

  * use a non scalar x (pad it with anything if scalar)
  * use a non scalar pos (idem)
  * use a pos with the same int64 or uint64 type than x

Samuel

Le 27/02/2020 à 16:17, JLan a écrit :
> I wonder if i have misunderstood the documentation for bitget, or if this is
> a bug? It seems to me that numbers > 2^53 are still not handled correctly.
> --> a=uint64(2^61)
>   a  =   2305843009213693952
> --> b=uint64(2^61)+1
>   b  =   2305843009213693953
> --> bitget(a,1:64)
>   ans  =
>           column 1 to 32
>    0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
> 0  0  0  0  0  0  0
>           column 33 to 64
>    0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
> 0  0  0  0  1  0  0
>
> --> bitget(b,1:64)
>   ans  =
>           column 1 to 32
>    0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
> 0  0  0  0  0  0  0
>           column 33 to 64
>    0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
> 0  0  0  0  1  0  0
>
>
>
> --
> Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20200227/8bdb59b7/attachment.htm>


More information about the users mailing list