Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shajoezhu committed Sep 21, 2024
1 parent 47533f7 commit 647096a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/random/fastfunc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ inline double FastFunc::fastexp_lo(double y) {

inline double FastFunc::fastlog(double x) {
const float offset = 2047; // as int64_t: 0x409ffc00000....
double y = x;
int64_t* yint = (int64_t*)(&y);
//double y = x; int64_t* yint = reinterpret_cast<int64_t*>(&y);
int64_t* yint = reinterpret_cast<int64_t*>(&x);
int expon = ((*yint) >> 52) - 1023; // base-2 exponent of float
int index = ((*yint) >> (52-10)) & 1023; // upper 10 bits of mantissa
*yint |= 0x7ffffc0000000000; // convert float into remainder of mantissa; and
Expand Down

0 comments on commit 647096a

Please sign in to comment.