"{ Package: 'stx:libbasic' }"
DomainError subclass:#ZeroDivide
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'Kernel-Exceptions-Errors'
!
!ZeroDivide class methodsFor:'documentation'!
documentation
"
Raised when a division by zero is attempted.
"
!
examples
"
the following leads into a debugger:
[exBegin]
|divisor|
divisor := 0.
Transcript showCR: ( 5 / divisor ).
[exEnd]
the following does NOT leads into a debugger:
[exBegin]
|divisor|
divisor := 0.
[
Transcript showCR: ( 5 / divisor ).
] on:ZeroDivide
do:
[
Transcript flash.
]
[exEnd]
"
! !
!ZeroDivide class methodsFor:'initialization'!
initialize
NotifierString := 'division by zero'.
! !
!ZeroDivide methodsFor:'accessing'!
dividend
"Return the number that was being divided by zero."
^ parameter receiver
"
|a b|
a := 5.
b := 0.
Integer divisionByZeroSignal handle:[:ex |
Transcript showCR:('division by zero - dividend was: ' , ex dividend printString)
] do:[
a // b
]
"
! !
!ZeroDivide class methodsFor:'documentation'!
version
^ '$Header: /cvs/stx/stx/libbasic/ZeroDivide.st,v 1.5 2003-08-29 19:08:08 cg Exp $'
! !
ZeroDivide initialize!