negate: Binary Negation (!)

View source: R/binary.R

negateR Documentation

Binary Negation (!)

Description

Negates the binary number x. Negation x -> -x or -x -> x

Usage

negate(x)

Arguments

x

The number to be negated. A binary vector is expected.

Details

An »unsigned« number will be returned as »signed« regardless of whether the value is negative. No floating point supported.

Value

The negated number of x. Returns a binary vector with signed=TRUE

See Also

switchEndianess or fillUpToByte.

Examples

summary(rdiversity:::negate(as.binary(5, signed=TRUE)))
summary(rdiversity:::negate(as.binary(-5, signed=TRUE)))
summary(rdiversity:::negate(as.binary(5, signed=FALSE)))

rdiversity documentation built on May 6, 2022, 9:06 a.m.