コード例 #1
0
ファイル: mptypes.py プロジェクト: gnulinooks/sympy
def rand():
    """
    Returns an ``mpf`` with value chosen randomly from `[0, 1)`.
    The number of randomly generated bits in the mantissa is equal
    to the working precision.
    """
    return make_mpf(mpf_rand(mp.prec))
コード例 #2
0
ファイル: mptypes.py プロジェクト: jcockayne/sympy-rkern
def rand():
    """Return an mpf chosen randomly from [0, 1)."""
    return make_mpf(mpf_rand(mp.prec))