Martin, On 1/30/17 16:41 , Martin McClure wrote:
IEEE-754 does not define a "sign" operation. ANSI Smalltalk and ISO/IEC 10967 do, so it makes sense to provide a #sign that conforms to those standards -- answering -1, 0, or 1. IEEE-754 does define an isSignMinus operation, answering true or false, so it makes sense to provide that operation in addition to the ones specified by the other standards.
Yes on isSignMinus. It may also be useful to define #signBit, and implement #isSignMinus as ^self signBit = 1.
These types of messages are very useful for testing the implementation is doing the right thing IEEE-wise (hence VM-primitive-wise), so that it's possible to implement e.g. ISO 10967 with confidence.
Andres.