Thoughts on IEEE P754

Waldemar Horwat waldemar at google.com
Fri Aug 22 15:59:10 PDT 2008


Sam Ruby wrote:
>>> Now we've gone full circle without actually answering the question I asked:  What should the full result of converting 1.1 to a Decimal be in ECMAScript?
>>>
>>> "An error" or "you can't do it" is not a valid answer because it violates IEEE P754.
>> I'm clearly not following something.
>>
>> I'm suggesting that there not be any implicit conversions from
>> binary64 to decimal128.  I've made a suggestion as to what
>> Decimal.parse should do.  If there are no other means to do a
>> conversion, that I can't answer the question about what such a
>> non-existent method might do.
>>
>> If you suggest that we need to do implicit conversions, I am aware of
>> a few different mechanisms to do so.  I think that the one that
>> produces the most expected results would be based on
>> decimal128-convertFromDecimalCharacter.
>>
>> If we want to provide more explicit conversions, then such named
>> methods should match the definition in IEEE P754.
>>
>> I don't know how to more fully answer the question.

To comply with IEEE P754, we must provide conversions and they must have the (rather poor for Decimal128) semantics given by that standard.

    Waldemar


More information about the Es-discuss mailing list