VRP and division/remainder by 0
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jul 4 05:34:32 PDT 2016
On 7/3/16 7:18 PM, deadalnix wrote:
> Question is, what should VRP do when the denum range contains 0 ?
>
> I see 2 way forward:
> - 0 will fault, so not yield a result - hardware will fault. It can be
> ignored when doing VRP.
> - denum with 0 return a full range for division, union result's range
> while ignoring 0 and num range for remainder.
>
> Doing 1/ for division and 2/ for remainder seems to be the best choice
> to me. Thought ?
I think 1 works best for both / and %. -- Andrei
More information about the Digitalmars-d
mailing list