'From Cuis 5.0 [latest update: #4490] on 22 December 2020 at 12:46:03 pm'!

!LargeNegativeInteger methodsFor: 'mathematical functions' stamp: 'KenD 12/22/2020 12:42:17'!
sqrt
	"Answer the square root of the receiver."
	Smalltalk at: #Complex ifAbsent: [ 
		(PopUpMenu 
		confirm: 'Negative Square root: Complex number support is not loaded',
		               String newLineString, 'Would you like me to load it for you now?')
		ifTrue: [Feature require: #'Complex'] 
	].
	Smalltalk at: #Complex ifPresent: [ :cplx | ^((cplx basicReal: self imaginary: 0) sqrt) ].
	^NegativePowerError new signalReceiver: self selector: #sqrt arguments: {}! !


!SmallInteger methodsFor: 'mathematical functions' stamp: 'KenD 12/22/2020 12:42:31'!
sqrt

	self positive ifTrue: [^super sqrt].
	Smalltalk at: #Complex ifAbsent: [ 
		(PopUpMenu 
		confirm: 'Negative Square root: Complex number support is not loaded',
		               String newLineString, 'Would you like me to load it for you now?')
		ifTrue: [Feature require: #'Complex'] 
	].
	Smalltalk at: #Complex ifPresent: [ :cplx | ^((cplx basicReal: self imaginary: 0) sqrt) ].
	^NegativePowerError new signalReceiver: self selector: #sqrt arguments: {}! !

