Unum II announcement
Nicholas Wilson via Digitalmars-d
digitalmars-d at puremagic.com
Tue Feb 23 15:52:48 PST 2016
On Tuesday, 23 February 2016 at 20:22:19 UTC, jmh530 wrote:
> 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.
>
0 I think. 0/0 == 0*(/0)==0*inf and then the set of numbers
that represents that is the empty set == 0 (i think)
> 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?
There is no conversion to a sorn result. think of unum is to sorn
what a pointer is to an address space: a unum is a "location" in
that set.
a mapping of n bits to 2^n possible representations.
(my understanding)
More information about the Digitalmars-d
mailing list