power() (to Rob)

new topic     » topic index » view thread      » older message » newer message

Rob,
excuse me returning to this item. But now I'm convinced that the
function power(), which probably relies on the C function pow(), is not
correctly implemented into Euphoria. I compared pow() (Quick C) and
power() (Euphoria) by the following examples:


#include <math.h>
#include <stdio.h>
void main(void)
{   double a;
    a = pow((double)10,(double)-300)*pow((double)10,(double)-300);
    printf("%24.15e\n", a);
}
------------------------
Result:
  1.000000000000000e+000

    printf(1,"%24.15e\n",power(10,300)*power(10,-300))
------------------------
Result:
  1.000000000000033e+000

and it shows the Euphoria power() is NOT IEEE conform. Could it be that
the WATCOM C behaves different in comparison to (good old) Quick C ?

What is your idea about this difference? (But, please, don't answer:
"It's correct to 14 digits. That's not so bad."!) It should be - as the
C compiler is - IEEE conform!

Impatiently awaiting your response, Rolf

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu