SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

Mantis - Squeak
Viewing Issue Advanced Details
3311 Kernel feature always 03-15-06 18:36 07-15-06 11:57
KenD  
 
normal  
new  
open  
none    
none  
0003311: Complex Numbers are Wacky
Examples
 2i isNumber. "false"
 -4 ln. "NaN"
 -4 sqrt. "exception"

[I did another implementation which fixes these problems and adds hyperbolic math functions (see below)]
Current:
 2i isNumber. "false"
 -4 ln. "NaN"
 -4 sqrt. "exception"
After Fix:
 2i isNumber. "true"
 -4 ln. "(1.38629436111989 +3.141592653589793i)"
 -4 sqrt. "2.0i"


TESTED IN: Squeak image versions 3.8-6665 and 3.9a-7008.

INSTRUCTIONS:
  [1] Open a browser and remove class Complex.
  [2] File in the attached change set.
  [3] (optional) Run the KernelTests-Numbers>>Complex unit tests.

NOTE:
One test fails in 3.9alpha (but not in 3.8).
  ((1/2) + 2.1i) tanH arcTanH
yields a different result. [KernelTests-Numbers>>Complex>>testMath]

I suspect this is caused by some change elsewhere in Kernel-Numbers.

The old result matched the complex hyperbolic implementation in Chez Scheme.

Enjoy!
-KenD [Ken Dickey]
related to 0003540closed  ComplexTest>>testEquality errored in 3.9 7025 ; fix attached 
related to 0002688new  aNumber = (aNumber + 0 i) answer false 
related to 0002689new  isComplex method name is bad 
related to 0003725closed  [FIX] ComplexTest>>testEquality 
 NewComplex.zip [^] (6,426 bytes) 03-15-06 18:36

Notes
(0004490)
KenD   
03-15-06 18:46   
Oh, noted that I put a copyright in the change set.

Feel free to remove this and do anything else to make the code better.

I am only a very occasional Smalltalk coder and my style choices are probably not well informed.

Cheers,
-KenD