Boost logo

Boost :

Subject: Re: [boost] boost interval arithmetic
From: Павел Кудан (coodan_at_[hidden])
Date: 2015-01-14 12:42:34


 Simple example.

Say, we are trying to estimate some physical value with interval calculation depending on some measured values (as values are measured, they are not exact, known to us as some ranges of possible values, it's quite natural to use interval calculations here).

Let it be some mass.

A = [1,2]
B = [-1, 1]

M = A / B

Calculated result with boot interval is [-infinity, -1].

OK, but mass cannot be negative...

Correct part of answer [1, infinity] which means that we have at least estimation of minimum for calculated value is lost...

Wed, 14 Jan 2015 12:16:56 +0100 (CET) от Marc Glisse <marc.glisse_at_[hidden]>:
>On Tue, 13 Jan 2015, Павел Кудан wrote:
>
>> 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.
>
>Hello,
>
>I have a hard time understanding your post. Could you try explaining it
>again, maybe with more concrete examples of what boost is doing, what you
>would like instead and why?
>
>(I don't think this code is maintained, at least the email addresses of
>all the maintainers are outdated)
>
>--
>Marc Glisse
>
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

P. Coodan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk