Next: Number-truncation and round off, Previous: Number-shortcuts and iterators, Up: Number [Index]
Answer whether the receiver can be considered sufficiently close to num (this is done by checking equality if num is not a number, and by checking with 0.01% tolerance if num is a number).
Returns true if self is divisible by 2
Answer whether the receiver performs exact arithmetic. Most numeric classes do (in fact the only exceptions is Float and its descendants), so the default is to answer true rather than calling #subclassResponsibility.
Answer whether the receiver represents a finite quantity. Most numeric classes are for finite quantities, so the default is to answer true rather than calling #subclassResponsibility.
Answer whether the receiver represents an infinite quantity. Most numeric classes are for finite quantities, so the default is to answer false rather than calling #subclassResponsibility.
Answer whether the receiver is a Not-A-Number. Most numeric classes don’t handle nans, so the default is to answer false rather than calling #subclassResponsibility.
Answer ‘true’.
Answer whether the receiver is rational - false by default
Answer whether the receiver is < 0
Returns true if self is not divisible by 2
Answer whether the receiver is >= 0
Returns the sign of the receiver.
Answer whether the receiver is > 0
Next: Number-truncation and round off, Previous: Number-shortcuts and iterators, Up: Number [Index]