SomeNumber.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 19 Jan 2012 11:46:00 +0000
branchjv
changeset 17911 a99f15c5efa5
parent 17910 8d796ca8bd1d
child 17927 ae1c64e8ade2
permissions -rw-r--r--
Updated with /trunk

"
 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 $'
! !