MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / negative

Function negative

ciphercore-base/src/ops/long_division.rs:345–347  ·  view source on GitHub ↗

Returns -binary_num, i.e. two's complement of a given number.

(binary_num: Node)

Source from the content-addressed store, hash-verified

343
344// Returns -binary_num, i.e. two's complement of a given number.
345fn negative(binary_num: Node) -> Result<Node> {
346 add_one(invert_bits(binary_num)?)
347}
348
349// Returns 1 where signed number is negative, and 0 elsewhere.
350fn is_negative(binary_num: Node) -> Result<Node> {

Callers 1

instantiateMethod · 0.85

Calls 2

add_oneFunction · 0.85
invert_bitsFunction · 0.85

Tested by

no test coverage detected