Re: OpenEuphoria on the raspberry pi
- Posted by jimcbrown (admin) Feb 16, 2013
- 2487 views
rkdavis said...
can someone running on x86 check that this change to Dand_bits() in be_runtime.c still works as expected?
object Dand_bits(d_ptr a, d_ptr b) /* double a AND b */ { double maxplus1 = ((double)UINTPTR_MAX) + 1; return and_bits( (uintptr_t)fmod(a->dbl,maxplus1), (uintptr_t)fmod(b->dbl,maxplus1)); }
it seems so far to be working as expected ont eh raspberry pi but i'd like to make sure it isn't mucking up x86
cat and_bits.ex -- andbits.ex atom index_hash = 0xffff_ffff index_hash *= 4 ? index_hash index_hash += 10 ? index_hash ? and_bits( 0xffff_ffff, index_hash ) ukscone@welham ~/euphoria/source $ build/eui and_bits.ex 1.717986918e+10 1.717986919e+10 6
Confirmed. All the tests behave the same with both versions of Dand_bits().
Still, I'd prefer an #ifdef be used here, as the fmod()s aren't necessary on x86 or x86_64 and probably take a speed hit.