[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] AlmostEqual bug ?



PureBytes Links

Trading Reference Links


I'm using Amibroker 4.90 SE, ver. 4.90.5, build: may 24, 2007
I think this code reveals an "AlmostEqual" function bug:


//
// NiceBug.AFL
//
// this code shows that, among others, AlmostEqual(2,-2) is TRUE
// 
// output:
//
// AlmostEqual(2,-2) = 1
//  ii = -4   /    jj = 1    /    AlmostEqual( ii , jj ) = 1
//  ii = -2   /    jj = 2    /    AlmostEqual( ii , jj ) = 1
//  ii = -1   /    jj = 4    /    AlmostEqual( ii , jj ) = 1
//  ii = 1   /    jj = -4    /    AlmostEqual( ii , jj ) = 1
//  ii = 2   /    jj = -2    /    AlmostEqual( ii , jj ) = 1
//  ii = 4   /    jj = -1    /    AlmostEqual( ii , jj ) = 1
//

printf("AlmostEqual(2,-2) = %g\n",AlmostEqual(2,-2));
for (ii=-100;ii<=100;ii++) 
    for (jj=-100;jj<=100;jj++) {
        apple = AlmostEqual(ii,jj);
        if ((apple) AND (NOT(abs(ii-jj)<0.0001))) 
            printf(" ii = %g   /    jj = %g    /    AlmostEqual( ii ,
jj ) = %g\n",ii,jj,apple) ;
        }





Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/