Package lib :: Module mathematics
[hide private]
[frames] | no frames]

Module mathematics

source code

Module for basic mathematical operations.

Functions [hide private]
float
order_of_magnitude(value)
Determine the order of magnitude of the given number.
source code
float
round_to_next_order(value)
Round the given value up to the next order of magnitude.
source code
Variables [hide private]
  __package__ = 'lib'

Imports: ceil, log10


Function Details [hide private]

order_of_magnitude(value)

source code 

Determine the order of magnitude of the given number.

For example, the number 1,234 will be give a value of 4.0.

Parameters:
  • value (float or int) - The value to determine the order of magnitude of.
Returns: float
The order of magnitude.

round_to_next_order(value)

source code 

Round the given value up to the next order of magnitude.

For example, the number 1,234 will be rounded up to 10,000.

Parameters:
  • value (float or int) - The value to determine the order of magnitude of.
Returns: float
The new value rounded up to the next order of magnitude.