operator

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBitOnPosition

func CheckBitOnPosition(number, position int) bool
  1. Left shift given number 1 by position-1 to create a number that has only set bit as position-th bit. temp = 1 << (position-1)
  2. If bitwise AND of number and temp is non-zero, then result is SET else result is NOT SET.

func Ternary

func Ternary[T comparable](condition bool, a, b T) T

Go Generics for Ternary function that returns the first value if the condition is true, and returns the second value if the condition is false

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL