SomeNumber.st
author Stefan Vogel <sv@exept.de>
Tue, 25 Feb 2014 14:32:13 +0100
changeset 16147 00010c63a9ef
parent 7471 c5d4bd612d9f
child 16664 9874b60d44e2
child 17711 39faaaf888b4
permissions -rw-r--r--
class: ProjectDefinition changed: #loadExtensions

"
 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.
"

"{ Package: 'stx:libbasic' }"

MetaNumber subclass:#SomeNumber
	instanceVariableNames:'realNumber'
	classVariableNames:''
	poolDictionaries:''
	category:'Magnitude-Numbers'
!

!SomeNumber class methodsFor:'documentation'!

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.
"
!

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

    [author:]
        Claus Gittinger

    [see also:]
        Number Infinity NotANumber
        Float ShortFloat Fraction FixedPoint Integer Complex
        FloatArray DoubleArray                                                                         
"
! !

!SomeNumber methodsFor:'arithmetic'!

* something
    "return the product of the receiver and the argument"

    ^ something productFromSomeNumber:self
!

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

    ^ something sumFromSomeNumber:self
!

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

    ^ something differenceFromSomeNumber:self
!

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

    ^ something quotientFromSomeNumber:self
!

< something
    "return true if the receiver is less than the argument"

    ^ something lessFromSomeNumber:self
!

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

    ^ something equalFromSomeNumber:self
! !

!SomeNumber methodsFor:'private-accessing'!

realNumber
    ^ realNumber
!

realNumber:something
    realNumber := something.
! !

!SomeNumber methodsFor:'queries'!

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

    ^ realNumber sign
! !

!SomeNumber class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic/SomeNumber.st,v 1.3 2003-07-02 09:52:23 cg Exp $'
! !