eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SomeNumber':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: SomeNumber


Inheritance:

   Object
   |
   +--Magnitude
      |
      +--ArithmeticValue
         |
         +--Number
            |
            +--MetaNumber
               |
               +--SomeNumber

Package:
stx:libbasic
Category:
Magnitude-Numbers
Version:
rev: 1.14 date: 2021/11/15 08:49:40
user: cg
file: SomeNumber.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


Only used internally during double dispatch, 
when MetaNumbers (INF and NAN) are involved.

copyright

COPYRIGHT (c) 2003 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Instance protocol:

arithmetic
o  * something
return the product of the receiver and the argument

o  + something
return the sum of the receiver and the argument

o  - something
return the difference of the receiver and the argument

o  / something
return the quotient of the receiver and the argument

o  negated
return the receiver negated

comparing
o  < something
return true if the receiver is less than the argument

o  = something
return true, if the argument represents the same numeric value
as the receiver, false otherwise.

Usage example(s):

        Float infinity = Infinity positive
        Infinity positive = Float infinity 
        Float negativeInfinity = Infinity negative
        Infinity negative = Float negativeInfinity 
        Float negativeInfinity = Infinity positive
        Infinity positive = Float negativeInfinity 

double dispatching
o  differenceFromSomeNumber: someNumber
realNumber isNaN ifTrue:[^ self ].

Usage example(s):

^ realNumber differenceFromSomeNumber:someNumber

printing
o  printOn: aStream
(comment from inherited method)
append a printed description of the receiver to aStream

private-accessing
o  realNumber

o  realNumber: something

queries
o  isFinite
return true, if the receiver is a finite number (not NaN and not +/-INF)

o  isInfinite
return true, if the receiver is an infinite number (+Inf or -Inf)

o  isNaN
return true, if the receiver is an invalid number (NaN - not a number).

o  negative
true if the receiver is < 0

o  positive
return true if the receiver is >= 0

o  sign
return the sign of the receiver (-1, 0 or 1)

o  strictlyPositive
true if the receiver is > 0



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 14:23:38 GMT