std-setbit


Synopsis

(std-setbit <val> <flag>)

Description

std-setbit returns the new flag with the bitvalue val enabled.

It used to enable a setting in a flag, which is used to store independent logical values in a single integer number. It uses bit values and not bit positions because the online help for flags uses bit values too, such as the initget flag: 1,2,4,8,16,32,64,128

Same as (logior val flag)

Example

(std-setbit 128 1) => 129

Arguments

val: An integer number representing a bitvalue.

flag: A integer number representing a flag, a logical sum of bitvalues.

Return Value

A integer number, the new flag.

Side Effects

None.

Module

(std-require 'STDMATH)

Defined in STDMATH