Skip to content

BITPOS Wrong examples results #20

Open
@jrgcubano

Description

@jrgcubano

Hello. I was checking the BITPOS (https://redis.io/commands/bitpos/) examples I realized that the results may be wrong in the official docs. I have executed the same commands using Redis docker's official image (version 7.0.8):

> SET mykey "\xff\xf0\x00"
"OK"

 > BITPOS mykey 0
(integer) 12

 > SET mykey "\x00\xff\xf0"
"OK"

 > BITPOS mykey 1 0
(integer) 8

 > BITPOS mykey 1 2
(integer) 16

 > BITPOS mykey 1 2 -1 BYTE
(integer) 16

 > BITPOS mykey 1 7 15 BIT
(integer) 8

 > set mykey "\x00\x00\x00"
"OK"

 > BITPOS mykey 1
(integer) -1

 > BITPOS mykey 1 7 -3 BIT
(integer) -1
> 

Would it make sense to do a separate PR?

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions