Boost logo

Boost :

Subject: [boost] boost interval arithmetic
From: Павел Кудан (coodan_at_[hidden])
Date: 2015-01-13 12:48:02

The difference in behaviour of comparison operators and basic arithmetic operators looks as probable misconception.

Default and changeable behaviour of comparison operators consists in throwing exception in intermediate situation (intersecting intervals, ! (a>b) == (a <= b) is not applicable). Great decision for correct migration from float numeric code.

The only and unchangeable behaviour of arithmetic operators consists in silent returning only one of possible intervals in intermediate situation (possible return is not single, multiple interval result). The source of mistakes and undesired behaviour at migration from float numeric.

At least, throwing exception by arithmetic operators at intermediate situation would provide behaviour unity of comparison and arithmetic operators and functions.

Best regards,
Pavel Coodan

Boost list run by bdawes at, gregod at, cpdaniel at, john at