Comment

Comment by ralphb

This is well-known, and almost trivial. But because I am curious I looked this up in NR 3rd edition. Section 7.1.5 says

> The steps above that convert a 64-bit integer to a double precision floating-point value involves both a non-trivial type conversion and a 64-bit floating multiply. They are performance bottlenecks. One can instead directly move the random bits into the right place in the double word with a union structure, a mask, and some 64-bit logical operations; but in our experience this is not significantly faster

It goes on to describe a lagged Fibonacci generator which generates values directly as floating point.

parent ralphb 4 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton