5947
|
1 |
"{ Package: 'stx:libbasic' }"
|
|
2 |
|
|
3 |
DomainError subclass:#ZeroDivide
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Magnitude-Numbers'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!ZeroDivide methodsFor:'accessing'!
|
|
12 |
|
|
13 |
dividend
|
|
14 |
"Return the number that was being divided by zero."
|
|
15 |
|
5969
|
16 |
^ parameter receiver
|
5947
|
17 |
|
|
18 |
"
|
|
19 |
|a b|
|
|
20 |
|
|
21 |
a := 5.
|
|
22 |
b := 0.
|
|
23 |
Integer divisionByZeroSignal handle:[:ex |
|
5969
|
24 |
Transcript showCR:('division by zero - dividend was: ' , ex dividend printString)
|
5947
|
25 |
] do:[
|
|
26 |
a // b
|
|
27 |
]
|
|
28 |
"
|
|
29 |
! !
|
|
30 |
|
|
31 |
!ZeroDivide class methodsFor:'documentation'!
|
|
32 |
|
|
33 |
version
|
5969
|
34 |
^ '$Header: /cvs/stx/stx/libbasic/ZeroDivide.st,v 1.2 2001-09-05 08:42:54 cg Exp $'
|
5947
|
35 |
! !
|