pencil.math.general
Contains the definitions various short mathematicl function.
Functions
|
is_number(num_str) |
|
is_int(num_str) |
|
is_float(num_str) |
|
is_iterable(i) |
|
log_range(a, b, include_ab=False, finer_factor=1) |
|
round_next_magnitude(num) |
|
natural_sort(string_list, reverse=False) |
Module Contents
- pencil.math.general.is_number(num_str)
is_number(num_str)
Checks if string s is a number.
- Parameters:
num_str (string) – String containing the number to be checked.
- pencil.math.general.is_int(num_str)
is_int(num_str)
Checks if string num_str is an int.
- Parameters:
num_str (string) – String containing the number to be checked.
- pencil.math.general.is_float(num_str)
is_float(num_str)
Checks if string num_str is a float.
- Parameters:
num_str (string) – String containing the number to be checked.
- pencil.math.general.is_iterable(i)
is_iterable(i)
Checks if i is an iterable.
- Parameters:
i (obj) – Object to be checked.
- pencil.math.general.log_range(a, b, include_ab=False, finer_factor=1)
log_range(a, b, include_ab=False, finer_factor=1)
Compute the logarithmic range between a and b.
- Parameters:
Examples
>>> log_range(4, 40) [4, 5, 6, 7, 8, 9, 10, 20, 30, 40]