Unum II announcement

jmh530 via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 23 12:22:19 PST 2016


On Monday, 22 February 2016 at 05:08:13 UTC, Nick B wrote:
>
> I strongly recommend that you download the presentation 
> [Powerpoint, 35 pages] as there are lots of Notes with the 
> presentation.
>

I had a chance to go through the presentation a bit.

The part about SORNs is a little confusing. For instance, suppose 
I divide 0 by 0 using unums. What would be internally 
represented? I assume that it has to be the SORN because it is 
encompasses all the unums plus arbitrary ranges of unums.

For instance, the 0's could be represented by 00 in the 2bit unum 
on page 3. But alternately, they could be expressed as 0010 in 
the SORN calculation. However, the result should be the SORN 1111 
from page 7 because the unum is undefined.

In my head, I imagine the process would be something like, I type
unum x = 0;
this creates a SORN variable equal to 0010 in bits.

I then divide
auto y = x / x;
Behind the scenes, it will do the table lookup and give y as the 
SORN representing 1111 in bits.

If instead of the above for y, it does
auto z = x / 1
where 1 is a unum literal, then it will get the unum value of the 
SORN in each case and do the appropriate operation as unums, get 
the unum result, then convert that to a SORN result.

Does this make sense?


More information about the Digitalmars-d mailing list