std-lognot


Synopsis

(std-lognot <int>)

Description

std-lognot calculates the bitwise (logical) NOT (1's complement) of the number.

It returns the integer representation of the bitwise inversion of the number.

The integer is represented as a signed shortnum, 15 + 1 bits.

Yes, it is the same as (~ int), only with a different name.~ is hard to read and remember.

Truth table:
bit	=> not
0	=> 1
1	=> 0

Examples

(std-lognot 0) => -1
(std-lognot 1) => -2
(std-lognot -1) => 0

Arguments

int: Integer number.

Return Value

A signed short integer. (16 bit)

Side Effects

None.

Module

(std-require 'STDMATH)

Defined in STDMATH