Advanced Computing Platform for Theoretical Physics


Commit acfe1770 authored by mikeaclark's avatar mikeaclark
Browse files

Small fix to int division

git-svn-id: be54200a-260c-0410-bdd7-ce6af2a381ab
parent 610ecbb7
// this will evaluate wrong for (1/L^3) < 5e-7, i.e., L=100
// this will evaluate wrong for (1/L^3) < 3e-7
#define FAST_INT_DIVIDE(a, b) \
((int)(__fdividef((float)a, (float)b)+0.0000005f))
((int)(__fdividef((float)a, (float)b)+0.0000003f))
#define FAST_INT_MOD(a, b) (a - FAST_INT_DIVIDE(a,b)*b)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment