fractions.Fraction.from_float()

from_float(flt) This class method constructs a Fraction representing the exact value of flt, which must be a float. Beware that Fraction.from_float(0.3) is not the same value as Fraction(3, 10). Note From Python 3.2 onwards, you can also construct a Fraction instance directly from a float.

fractions.Fraction.from_decimal()

from_decimal(dec) This class method constructs a Fraction representing the exact value of dec, which must be a decimal.Decimal instance. Note From Python 3.2 onwards, you can also construct a Fraction instance directly from a decimal.Decimal instance.

fractions.Fraction.denominator

denominator Denominator of the Fraction in lowest term.

fractions.Fraction

class fractions.Fraction(numerator=0, denominator=1) class fractions.Fraction(other_fraction) class fractions.Fraction(float) class fractions.Fraction(decimal) class fractions.Fraction(string) The first version requires that numerator and denominator are instances of numbers.Rational and returns a new Fraction instance with value numerator/denominator. If denominator is 0, it raises a ZeroDivisionError. The second version requires that other_fraction is an instance of numbers.Rational and ret

fpectl.turnon_sigfpe()

fpectl.turnon_sigfpe() Turn on the generation of SIGFPE, and set up an appropriate signal handler.

fpectl.turnoff_sigfpe()

fpectl.turnoff_sigfpe() Reset default handling of floating point exceptions.

fpectl.FloatingPointError

exception fpectl.FloatingPointError After turnon_sigfpe() has been executed, a floating point operation that raises one of the IEEE-754 exceptions Division by Zero, Overflow, or Invalid operation will in turn raise this standard Python exception.

format()

format(value[, format_spec]) Convert a value to a “formatted” representation, as controlled by format_spec. The interpretation of format_spec will depend on the type of the value argument, however there is a standard formatting syntax that is used by most built-in types: Format Specification Mini-Language. The default format_spec is an empty string which usually gives the same effect as calling str(value). A call to format(value, format_spec) is translated to type(value).__format__(value, fo

fnmatch.translate()

fnmatch.translate(pattern) Return the shell-style pattern converted to a regular expression. Example: >>> import fnmatch, re >>> >>> regex = fnmatch.translate('*.txt') >>> regex '.*\\.txt\\Z(?ms)' >>> reobj = re.compile(regex) >>> reobj.match('foobar.txt') <_sre.SRE_Match object; span=(0, 10), match='foobar.txt'>

fnmatch.fnmatchcase()

fnmatch.fnmatchcase(filename, pattern) Test whether filename matches pattern, returning True or False; the comparison is case-sensitive.