httk.core.vectors.fracmath module

httk.core.vectors.fracmath.any_to_fraction(arg, min_accuracy=Fraction(1, 10000))[source]

min_accuracy: we always assume the accuracy is at least this good. i.e., with min_accuracy=1/10000, we take 0.33 to really mean 0.3300, because we assume people meaning 1/3 at least makes the effort to write 0.3333

httk.core.vectors.fracmath.best_rational_in_interval(low, high)[source]
httk.core.vectors.fracmath.frac_acos(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]

Return the arccosine of x in radians.

httk.core.vectors.fracmath.frac_acos_alt(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]

Return the arc cosine (measured in radians) of Decimal x.

httk.core.vectors.fracmath.frac_acos_old(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]

Return the arc cosine (measured in radians) of Decimal x.

httk.core.vectors.fracmath.frac_asin(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]

Return the arc sine (measured in radians) of Decimal x.

httk.core.vectors.fracmath.frac_atan(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]

Return the arctangent of x in radians.

httk.core.vectors.fracmath.frac_atan2(y, x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]

Return the arctangent of y/x in radians.

Unlike atan(y/x), the signs of both x and y are considered.

httk.core.vectors.fracmath.frac_atan_old(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]

Return the arctangent of x in radians.

httk.core.vectors.fracmath.frac_cos(x, prec=Fraction(1, 10000000000), limit=True, degrees=False)[source]
httk.core.vectors.fracmath.frac_exp(x, prec=Fraction(1, 10000000000), limit=True)[source]

Return e raised to the power of x.

httk.core.vectors.fracmath.frac_exp_old(x, prec=Fraction(1, 10000000000), limit=True)[source]

Return e raised to the power of x.

httk.core.vectors.fracmath.frac_log(x, base=None, prec=Fraction(1, 10000000000), limit=True)[source]

Return the logarithm of x to the given base.

If the base not specified, return the natural logarithm (base e) of x.

TODO: Fix: this fails for moderately large arguments.

httk.core.vectors.fracmath.frac_log10(x, prec=Fraction(1, 10000000000), limit=True)[source]

Return the base 10 logarithm of x.

httk.core.vectors.fracmath.frac_log_old(x, base=None, prec=Fraction(1, 10000000000), limit=True)[source]

Return the logarithm of x to the given base.

If the base not specified, return the natural logarithm (base e) of x.

httk.core.vectors.fracmath.frac_pi(prec=Fraction(1, 10000000000), limit=True)[source]

Compute Pi to the precision prec.

httk.core.vectors.fracmath.frac_pi_old(prec=Fraction(1, 10000000000), limit=True)[source]

Compute Pi to the precision prec.

httk.core.vectors.fracmath.frac_sin(x, prec=Fraction(1, 10000000000), limit=True, degrees=False)[source]
httk.core.vectors.fracmath.frac_sin_old(x, prec=Fraction(1, 10000000000), limit=True, degrees=False)[source]
httk.core.vectors.fracmath.frac_sqrt(x, prec=Fraction(1, 10000000000), limit=True)[source]
httk.core.vectors.fracmath.frac_sqrt_old(x, prec=Fraction(1, 10000000000), limit=True)[source]
httk.core.vectors.fracmath.frac_tan(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]

Return the tangent of x.

httk.core.vectors.fracmath.fraction_from_continued_fraction(cf)[source]
httk.core.vectors.fracmath.get_continued_fraction(p, q)[source]
httk.core.vectors.fracmath.integer_sqrt(n)[source]
httk.core.vectors.fracmath.is_string(arg)[source]
httk.core.vectors.fracmath.main()[source]
httk.core.vectors.fracmath.run_alot(func, name, mathfun, fsmall, fmid, flarge, interval_within_one=False, positive=False, skip_worst=False)[source]
httk.core.vectors.fracmath.string_to_val_and_delta(arg, min_accuracy=Fraction(1, 10000))[source]