author | penk |
Mon, 10 Feb 2003 17:39:23 +0100 | |
changeset 7019 | 6591ea303fbd |
parent 6690 | 07ef28245da8 |
child 7584 | 2104df18c2af |
permissions | -rw-r--r-- |
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 |
|
6690
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
18 |
!ZeroDivide class methodsFor:'initialization'! |
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
19 |
|
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
20 |
initialize |
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
21 |
NotifierString := 'division by zero'. |
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
22 |
! ! |
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
23 |
|
5947 | 24 |
!ZeroDivide methodsFor:'accessing'! |
25 |
||
26 |
dividend |
|
27 |
"Return the number that was being divided by zero." |
|
28 |
||
5969 | 29 |
^ parameter receiver |
5947 | 30 |
|
31 |
" |
|
32 |
|a b| |
|
33 |
||
34 |
a := 5. |
|
35 |
b := 0. |
|
36 |
Integer divisionByZeroSignal handle:[:ex | |
|
5969 | 37 |
Transcript showCR:('division by zero - dividend was: ' , ex dividend printString) |
5947 | 38 |
] do:[ |
39 |
a // b |
|
40 |
] |
|
41 |
" |
|
42 |
! ! |
|
43 |
||
44 |
!ZeroDivide class methodsFor:'documentation'! |
|
45 |
||
46 |
version |
|
6690
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
47 |
^ '$Header: /cvs/stx/stx/libbasic/ZeroDivide.st,v 1.4 2002-07-31 14:33:05 cg Exp $' |
5947 | 48 |
! ! |
6690
07ef28245da8
notifier now initialized here
Claus Gittinger <cg@exept.de>
parents:
6218
diff
changeset
|
49 |
ZeroDivide initialize! |