'From Cuis 6.0 [latest update: #5663] on 27 February 2023 at 6:41:19 am'!

!Complex class methodsFor: 'instance creation' stamp: 'KenD 2/27/2023 06:41:12'!
real: realPart imaginary: imaginaryPart

	"This implementation allows reducing Complex to Integer or Fraction, avoiding instances of Complex where the imaginary part is zero. It is currently disabled."
	"
	^ (imaginaryPart isFloat not and: [ imaginaryPart isZero ])
		ifTrue: [ realPart ]
		ifFalse: [ self basicReal: realPart imaginary: imaginaryPart ]
	"

	"Complex `numbers` break invariant relations required of instances of subclasses of Number.
	 For this reason, we always answer an instance of Complex, rather than using the code above. 
	 Note my Class Comment."
	^ self basicReal: realPart imaginary: imaginaryPart! !
