maths.base_neg2_conversion

Functions

decimal_to_negative_base_2(→ int)

This function returns the number negative base 2

Module Contents

maths.base_neg2_conversion.decimal_to_negative_base_2(num: int) int
This function returns the number negative base 2

of the decimal number of the input data.

Args:

int: The decimal number to convert.

Returns:

int: The negative base 2 number.

Examples:
>>> decimal_to_negative_base_2(0)
0
>>> decimal_to_negative_base_2(-19)
111101
>>> decimal_to_negative_base_2(4)
100
>>> decimal_to_negative_base_2(7)
11011