Skip to content

How to implement bitwise operations? #572

Open
@KunMinX

Description

@KunMinX

Currently, there are no operators like bitAnd or bitOr.
The following is my usage in the Android Room framework, for example, feature & 0x0001 equals 0x0001.
I want to use bitwise operators in where or order by clauses:

@Query("select * from note where isDeleted = 0 order by (feature & 0x0001) = 0x0001 desc, create_time desc")
fun notes(): List<Note>

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