Re: pow(2) returns slightly different result compared to other platforms' implementation

2016-10-03 Thread Matthew Dillon
Intel does not have a 128-bit FP representation. 80-bits is as good as it gets. The 80-bit form is stored in a 128-bit memory location. -Matt

Re: pow(2) returns slightly different result compared to other platforms' implementation

2016-09-24 Thread Matthew Dillon
Hmmm. Yah, 10 ^ -20 cannot be exactly represented in any 2s complement FP format. So unless there is a requirement that it round up, that result is perfectly valid. long double d; d = pow(10.0, -20.0); printf("%23.23Lg\n", d); d = powl(10.0, -20.0);

Re: pow(2) returns slightly different result compared to other platforms' implementation

2016-09-23 Thread Aleksej Lebedev
Actually, it doesn't matter much. I just noticed that fpgetprec is deprecated while new API fesetround doesn't allow to set up 80-bit precision (63-bit mantissa). So, I fixed the test by simply switching to powl. -- Aleksej Lebedev On 22/09/16 20:18, Aleksej Lebedev wrote: I did some

Re: pow(2) returns slightly different result compared to other platforms' implementation

2016-09-22 Thread Aleksej Lebedev
I did some investigation and found that FreeBSD and therefore DragonFly allows to set up rounding precision modes via fpgetprec(3), but the rounding precision that is supposed to be enough (FP_PE) is already set by default. Also, quick search showed that IEEE only requires so called exact

pow(2) returns slightly different result compared to other platforms' implementation

2016-09-22 Thread Aleksej Lebedev
Hi, everyone! I'm porting ChezScheme that was recently opensourced to DragonFly. I was able to compile it, but lots of tests are failing. At least some of them are due to (minor) bugs in DragonFly (http://bugs.dragonflybsd.org/issues/2951). Also I noticed that one of the tests is failing