November 04, 2015 Re: How to detect overflow | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Wednesday, 4 November 2015 at 08:18:00 UTC, Ali Çehreli wrote:
> Thanks. I've noticed that the parameter of the subtraction functions should be named 'underflow', no?
Integer math cannot underflow, unless you define division to be equivalent to division over reals.
overflow => higher/lower than max/min
underflow => wrongly rounded to zero (smaller than epsilon)
Underflow can lead to unexpected division by zero errors in float expressions.
|
November 04, 2015 Re: How to detect overflow | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On 11/04/2015 02:01 AM, Ola Fosheim Grøstad wrote: > On Wednesday, 4 November 2015 at 08:18:00 UTC, Ali Çehreli wrote: >> Thanks. I've noticed that the parameter of the subtraction functions >> should be named 'underflow', no? > > Integer math cannot underflow, unless you define division to be > equivalent to division over reals. > > overflow => higher/lower than max/min > > underflow => wrongly rounded to zero (smaller than epsilon) > > Underflow can lead to unexpected division by zero errors in float > expressions. Thanks. It looks like I've been making stuff up on this page: :( http://ddili.org/ders/d.en/arithmetic.html Ali |
November 04, 2015 Re: How to detect overflow | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Wednesday, 4 November 2015 at 10:06:47 UTC, Ali Çehreli wrote:
> Thanks. It looks like I've been making stuff up on this page: :(
>
> http://ddili.org/ders/d.en/arithmetic.html
It's a common source for confusion, the word "underflow" is a bit misleading. Maybe better to use the term "zero-flushed".
|
Copyright © 1999-2021 by the D Language Foundation