Do you like bounded integrals?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 30 07:07:22 PDT 2016


On 08/29/2016 11:37 PM, Chris Wright wrote:
> On Mon, 29 Aug 2016 18:20:05 +0000, tsbockman wrote:
>
>> On Tuesday, 23 August 2016 at 20:40:06 UTC, Andrei Alexandrescu wrote:
>>> When composing, do the limits compose meaningfully?
>>
>> They should. Generally speaking, if that doesn't produce reasonable
>> bounds (leaving aside rounding errors) at the end of the computation, it
>> means that the logic of the computation itself is wrong.
>
> The ranges expand very fast. Addition and subtraction double the range,
> multiplication squares it, exponentiation is n^^n. Larger bounds are
> usually not useful bounds.

Yah, was thinking of the same. So before long you run into the bounds, 
at which points it's all up to the checking policy. -- Andrei



More information about the Digitalmars-d mailing list