Number#

class basencode.Number(n: Union[int, float, str, Tuple[Union[int, str]], List[Union[int, str]]], base: int = 10, digits: Optional[List[str]] = None, radix_point: str = '.')#

Constructs a Float if a number with a radix point is provided, otherwise an Integer.

Parameters:
  • n – The number to be converted to decimal and stored

  • base – The base in which the number provided is represented (this information is used to convert the number to decimal)

  • digits – The digits used in the provided representation of the number

  • radix_point – The radix point used in the provided representation of the number, if at all

Returns:

A Float if a number with a radix point is provided, otherwise an Integer

Return type:

Float | Integer