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