Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000332 [ALGLIB] General major have not tried 2010-05-18 19:47 2010-05-26 12:34
Reporter artyomstv View Status public  
Assigned To SergeyB
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0000332: FIXED: Mistake in C++ implementation of ap::complex::operator/=(complex& z)
Description Wrong code:

if( fabs(z.y)<fabs(z.x) ){
    e = z.y/z.x;
    f = z.x+z.y*e;
    result.x = (z.x+z.y*e)/f;
    result.y = (z.y-z.x*e)/f;
} else {
    e = z.x/z.y;
    f = z.y+z.x*e;
    result.x = (z.y+z.x*e)/f;
    result.y = (-z.x+z.y*e)/f;
}

Correct code:

if( fabs(z.y)<fabs(z.x) ){
    e = z.y/z.x;
    f = z.x+z.y*e;
    result.x = (x+y*e)/f;
    result.y = (y-x*e)/f;
} else {
    e = z.x/z.y;
    f = z.y+z.x*e;
    result.x = (y+x*e)/f;
    result.y = (y*e-x)/f;
}
Additional Information Have not checked any other operators. Maybe it is neccessary to check them.
Programming language C++
Attached Files

- Relationships

-  Notes
(0000050)
SergeyB (administrator)
2010-05-19 08:38

Fixed.

Thanks for your bug report!

- Issue History
Date Modified Username Field Change
2010-05-18 19:47 artyomstv New Issue
2010-05-18 19:47 artyomstv Programming language => C++
2010-05-19 08:36 SergeyB Status new => assigned
2010-05-19 08:36 SergeyB Assigned To => SergeyB
2010-05-19 08:38 SergeyB Note Added: 0000050
2010-05-19 08:38 SergeyB Status assigned => resolved
2010-05-19 08:38 SergeyB Fixed in Version => [NOT RELEASED YET] Next release
2010-05-19 08:38 SergeyB Resolution open => fixed
2010-05-26 12:34 SergeyB Category AlgoPascal => General
2010-05-26 12:34 SergeyB Summary Mistake in C++ implementation of ap::complex::operator/=(complex& z) => FIXED: Mistake in C++ implementation of ap::complex::operator/=(complex& z)


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker