Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Data Structures | |
class | NotANumber |
Functions | |
def | extract |
def | unexpo |
def | roundfrac |
def | fix |
def | sci |
def | test |
Variables | |
list | __all__ = ["fix","sci","NotANumber"] |
tuple | decoder = re.compile(r'^([-+]?)0*(\d*)((?:\.\d*)?)(([eE][-+]?\d+)?)$') |
string | NotANumber = 'fpformat.NotANumber' |
General floating point formatting functions. Functions: fix(x, digits_behind) sci(x, digits_behind) Each takes a number or a string and a number of digits as arguments. Parameters: x: number to be formatted; or a string resembling a number digits_behind: number of digits behind the decimal point
def fpformat.extract | ( | s) |
Return (sign, intpart, fraction, expo) or raise an exception: sign is '+' or '-' intpart is 0 or more digits beginning with a nonzero fraction is 0 or more digits expo is an integer
Definition at line 32 of file fpformat.py.
def fpformat.fix | ( | x, | |
digs | |||
) |
Format x as [-]ddd.ddd with 'digs' digits after the point and at least one digit before. If digs <= 0, the point is suppressed.
Definition at line 87 of file fpformat.py.
References extract(), roundfrac(), and unexpo().
def fpformat.roundfrac | ( | intpart, | |
fraction, | |||
digs | |||
) |
def fpformat.sci | ( | x, | |
digs | |||
) |
Format x as [-]d.dddE[+-]ddd with 'digs' digits after the point and exactly one digit before. If digs is <= 0, one digit is kept and the point is suppressed.
Definition at line 103 of file fpformat.py.
References extract(), sre_parse.max, and roundfrac().
def fpformat.test | ( | ) |
Interactive test run.
Definition at line 135 of file fpformat.py.
References fix(), fileinput.input(), and sci().
def fpformat.unexpo | ( | intpart, | |
fraction, | |||
expo | |||
) |
list __all__ = ["fix","sci","NotANumber"] |
Definition at line 16 of file fpformat.py.
tuple decoder = re.compile(r'^([-+]?)0*(\d*)((?:\.\d*)?)(([eE][-+]?\d+)?)$') |
Definition at line 19 of file fpformat.py.
string NotANumber = 'fpformat.NotANumber' |
Definition at line 30 of file fpformat.py.