Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003311 [Squeak] Kernel feature always 03-15-06 18:36 07-15-06 11:57
Reporter KenD View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version
Summary 0003311: Complex Numbers are Wacky
Description 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)]
Additional Information 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]
Attached Files  NewComplex.zip [^] (6,426 bytes) 03-15-06 18:36

- Relationships

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

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 

- Notes
(0004490 - 245 - 287 - 287 - 287 - 287 - 287)
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
 

- Issue History
Date Modified Username Field Change
03-15-06 18:36 KenD New Issue
03-15-06 18:36 KenD File Added: NewComplex.zip
03-15-06 18:38 KenD Issue Monitored: KenD
03-15-06 18:46 KenD Note Added: 0004490
07-15-06 11:57 MarcusDenker Relationship added related to 0003540
07-15-06 11:57 MarcusDenker Relationship added related to 0002688
07-15-06 11:57 MarcusDenker Relationship added related to 0002689
07-15-06 11:57 MarcusDenker Relationship added related to 0003725


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
53 total queries executed.
35 unique queries executed.
Powered by Mantis Bugtracker