Unum II announcement

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 24 12:59:20 PST 2016


On 24.02.2016 00:52, Nicholas Wilson wrote:
> 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)
>

The result should be everything. a/b is a number c such that a = b·c. If 
a and b are 0, c is arbitrary.


>> 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)
>

Unums represent either single numbers or entire segments and those 
segments are not closed under the arithmetic operations, so without a 
efficient representation for sets, Unums are not useful as a more 
rigorous replacement for floating point numbers.

The suggested tables for the arithmetic operations seem to map two Unums 
to one 16 bit SORN. (See slide 27 and 30 if in doubt.)


More information about the Digitalmars-d mailing list