Add st-handle.h
[panda.git] / st / Float.st
blobd495c9b4403f5274eac93efef90e504a824f0e5d
2 Copyright (c) 2008 Vincent Geddes
3 Copyright (c) 2007 Luca Bruno
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the 'Software'), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 DEALINGS IN THE SOFTWARE.
24 "coercing"
26 Float method!
27 asFloat
28     ^ self!
30 Float method!
31 unity
32     ^ 1.0!
34 Float method!
35 generality
36     ^ 50!
38 Float method!
39 zero
40     ^ 0.0!
42 Float method!
43 coerce: aNumber
44     ^ aNumber asFloat!
47 "testing"
49 Float method!
50 isFloat
51     ^ true!
54 "comparing"
56 Float method!
57 < aNumber
58      <primitive: 'Float_lt'>
59          ^ super < aNumber!
61 Float method!
62 > aNumber
63      <primitive: 'Float_gt'>
64          ^ super > aNumber!
66 Float method!
67 <= aNumber
68      <primitive: 'Float_le'>
69          ^ super <= aNumber!
71 Float method!
72 >= aNumber
73      <primitive: 'Float_ge'>
74          ^ super >= aNumber!
76 Float method!
77 = aNumber
78      <primitive: 'Float_eq'>
79          ^ super = aNumber!
81 Float method!
82 ~= aNumber
83      <primitive: 'Float_ne'>
84          ^ super ~= aNumber!
87 "arithmetic"
89 Float method!
90 + aNumber
91      <primitive: 'Float_add'>
92          ^ super + aNumber!
94 Float method!
95 - aNumber
96      <primitive: 'Float_sub'>
97          ^ super - aNumber!
99 Float method!
100 * aNumber
101      <primitive: 'Float_mul'>
102          ^ super * aNumber!
104 Float method!
105 / aNumber
106         <primitive: 'Float_div'>
107         ^ super / aNumber!
109 Float method!
110 \\ aNumber
111      self notYetImplemented!
113 Float method!
114 hash
115         <primitive: 'Float_hash'>
116         self primitiveFailed!
119 "printing"
121 Float method!
122 printStringBase: anInteger
123         <primitive: 'Float_printStringBase'>
124         self primitiveFailed!
126 Float method!
127 printOn: aStream base: anInteger
128         aStream nextPutAll: (self printStringBase: anInteger)!
130 "rounding & truncation"
132 Float method!
133 truncated
134         <primitive: 'Float_truncated'>
135         self primitiveFailed!
137 Float method!
138 fractionPart
139         <primitive: 'Float_fractionPart'>
140         self primitiveFailed!
142 Float method!
143 integerPart
144         <primitive: 'Float_integerPart'>
145         self primitiveFailed!
148 "mathematics"
150 Float method!
152         <primitive: 'Float_sin'>
153         self primitiveFailed!
155 Float method!
157         <primitive: 'Float_cos'>
158         self primitiveFailed!
160 Float method!
162         <primitive: 'Float_tan'>
163         self primitiveFailed!
165 Float method!
166 arcSin
167         <primitive: 'Float_arcSin'>
168         self primitiveFailed!
170 Float method!
171 arcCos
172         <primitive: 'Float_arcSin'>
173         self primitiveFailed!
175 Float method!
176 arcTan
177         <primitive: 'Float_arcTan'>
178         self primitiveFailed!
180 Float method!
182         <primitive: 'Float_exp'>
183         self primitiveFailed!
185 Float method!
187         <primitive: 'Float_ln'>
188         self primitiveFailed!
190 Float method!
192         <primitive: 'Float_log'>
193         self primitiveFailed!
195 Float method!
196 sqrt
197         <primitive: 'Float_sqrt'>
198         self primitiveFailed!