'From Squeak3.10beta of 22 July 2007 [latest update: #7159] on 30 October 2009 at 10:27:14 pm'!
"Change Set: M7409-Float-arcTan-Patch
Date: 30 October 2009
Author: nice
Patch for http://bugs.squeak.org/view.php?id=7409
arcTan: is not correct in case of negativeZero"!
!Float methodsFor: 'mathematical functions' stamp: 'nice 10/30/2009 22:21'!
arcTan: denominator
"Answer the angle in radians.
Optional. See Object documentation whatIsAPrimitive.
Implementation note: use sign in order to catch cases of negativeZero"
^self = 0.0
ifTrue: [denominator sign >= 0
ifTrue: [ 0 ]
ifFalse: [ self sign >= 0
ifTrue: [ Pi ]
ifFalse: [ Pi negated ]]]
ifFalse: [denominator = 0.0
ifTrue: [self > 0.0
ifTrue: [ Halfpi ]
ifFalse: [ Halfpi negated ]]
ifFalse: [denominator > 0
ifTrue: [ (self / denominator) arcTan ]
ifFalse: [self > 0
ifTrue: [ ((self / denominator) arcTan) + Pi ]
ifFalse: [ ((self / denominator) arcTan) - Pi ]]]]! !