[ Arithmetic | Reference Manual | Alphabetic Index ]

# breal_max(+Number, -Result)

Extracts the upper floating point bound of Number
Number
A number.
Result
A variable or float.

## Description

This predicate is used by the ECLiPSe compiler to expand evaluable arithmetic expressions. So a call to breal_max(Number, Result) is equivalent to
```    Result is breal_max(Number).
```
A bounded real is a real number represented by a lower and upper bound in floating point format. This predicate extracts the upper bound and unifies it with Result. If Number is not a bounded real, the result returned is equivalent to converting it to a bounded real first.

### Modes and Determinism

• breal_max(+, -) is det

### Exceptions

(4) instantiation fault
Number is not instantiated
(24) number expected
Number is a not a number.

## Examples

```Success:
?- breal_max(0.99__1.01, X).
X = 1.01

?- breal_max(1, X).
X = 1.0

?- breal_max(1.0, X).
X = 1.0

?- breal_max(1_10, X).
X = 0.10000000000000002

Error:
?- breal_max("a", Z).
number expected in breal_max("a", Z)

?- breal_max(2 + 4, Z).
number expected in breal_max(2 + 4, Z)
```