[ Type Testing | Reference Manual | Alphabetic Index ]

breal(?Breal)

Succeeds if Breal is a bounded real number.
Breal
A term.

Description

Used to test whether a term is a bounded real number. A bounded real (breal) is conceptually a real number, and it is represented by a lower and upper bound in floating point format.

Modes and Determinism

Fail Conditions

Fails if Breal is not a bounded real number

Examples

Success:
    ?- breal(0.99__1.01).
    Yes (0.00s cpu)

    ?- X is breal(3), breal(X).
    X = 3.0__3.0
    Yes (0.00s cpu)

    ?- X is breal(1) / 3, breal(X).
    X = 0.33333333333333331__0.33333333333333337
    Yes (0.00s cpu)

Fail:
    ?- breal(1.0).
    No (0.00s cpu)

    ?- breal(1).
    No (0.00s cpu)

    ?- breal("hello").
    No (0.00s cpu)

See Also

atomic / 1, integer / 1, number / 1, float / 1, real / 1, rational / 1, breal / 2