All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.bixilon.kotlinglm.BitwiseUtils.kt Maven / Gradle / Ivy

There is a newer version: 0.9.9.1-12
Show newest version
package de.bixilon.kotlinglm

// for flags

infix fun Byte.has(i: Int): Boolean = toInt().has(i)

infix fun Int.has(other: Int): Boolean = and(other) != 0
infix fun Int.hasnt(other: Int): Boolean = and(other) == 0
infix fun Int.wo(other: Int): Int = and(other.inv())

infix fun Long.has(other: Long): Boolean = and(other) != 0L
infix fun Long.hasnt(other: Long): Boolean = and(other) == 0L
infix fun Long.wo(other: Long): Long = and(other.inv())




© 2015 - 2024 Weber Informatics LLC | Privacy Policy