SomeNumber.st
author Stefan Vogel <sv@exept.de>
Fri, 27 Oct 2017 16:14:37 +0200
branchexpecco_2_11_1_branch
changeset 22329 20662662693b
parent 16664 9874b60d44e2
child 18120 e3a375d5f6a8
child 21212 66b6079fccba
permissions -rw-r--r--
Add 2.11.0 Patch

"
 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:'printing'!

printOn:aStream
    realNumber printOn:aStream.
! !

!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.4 2014-06-30 14:27:34 stefan Exp $'
! !