author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 11 Oct 2011 16:53:59 +0100 | |
branch | jv |
changeset 17883 | 209190914636 |
parent 17846 | 24edc476ac18 |
child 17892 | d86c8bd5ece3 |
permissions | -rw-r--r-- |
7439 | 1 |
" |
2 |
COPYRIGHT (c) 2003 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
"{ Package: 'stx:libbasic' }" |
|
14 |
||
15 |
MetaNumber subclass:#SomeNumber |
|
16 |
instanceVariableNames:'realNumber' |
|
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Magnitude-Numbers' |
|
20 |
! |
|
21 |
||
22 |
!SomeNumber class methodsFor:'documentation'! |
|
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 2003 by eXept Software AG |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
7470 | 40 |
Only used internally during double dispatch, |
41 |
when MetaNumbers (INF and NAN) are involved. |
|
7439 | 42 |
|
43 |
[author:] |
|
44 |
Claus Gittinger |
|
45 |
||
46 |
[see also:] |
|
47 |
Number Infinity NotANumber |
|
48 |
Float ShortFloat Fraction FixedPoint Integer Complex |
|
49 |
FloatArray DoubleArray |
|
50 |
" |
|
51 |
! ! |
|
52 |
||
53 |
!SomeNumber methodsFor:'arithmetic'! |
|
54 |
||
55 |
* something |
|
56 |
"return the product of the receiver and the argument" |
|
57 |
||
58 |
^ something productFromSomeNumber:self |
|
59 |
! |
|
60 |
||
61 |
+ something |
|
62 |
"return the sum of the receiver and the argument" |
|
63 |
||
64 |
^ something sumFromSomeNumber:self |
|
65 |
! |
|
66 |
||
67 |
- something |
|
68 |
"return the difference of the receiver and the argument" |
|
69 |
||
70 |
^ something differenceFromSomeNumber:self |
|
71 |
! |
|
72 |
||
73 |
/ something |
|
74 |
"return the quotient of the receiver and the argument" |
|
75 |
||
76 |
^ something quotientFromSomeNumber:self |
|
77 |
! |
|
78 |
||
79 |
< something |
|
80 |
"return true if the receiver is less than the argument" |
|
81 |
||
82 |
^ something lessFromSomeNumber:self |
|
83 |
! |
|
84 |
||
85 |
= something |
|
7471 | 86 |
"return true, if the argument represents the same numeric value |
87 |
as the receiver, false otherwise." |
|
7439 | 88 |
|
89 |
^ something equalFromSomeNumber:self |
|
90 |
! ! |
|
91 |
||
7471 | 92 |
!SomeNumber methodsFor:'private-accessing'! |
93 |
||
94 |
realNumber |
|
95 |
^ realNumber |
|
96 |
! |
|
97 |
||
98 |
realNumber:something |
|
99 |
realNumber := something. |
|
100 |
! ! |
|
101 |
||
7439 | 102 |
!SomeNumber methodsFor:'queries'! |
103 |
||
104 |
sign |
|
7471 | 105 |
"return the sign of the receiver (-1, 0 or 1)" |
106 |
||
7439 | 107 |
^ realNumber sign |
108 |
! ! |
|
109 |
||
110 |
!SomeNumber class methodsFor:'documentation'! |
|
111 |
||
112 |
version |
|
17883
209190914636
svn:keywords property set correctly
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17846
diff
changeset
|
113 |
^ '$Id: SomeNumber.st 10717 2011-10-11 15:53:59Z vranyj1 $' |
17846 | 114 |
! ! |