def really_rand = [rand(2**64)].pack("Q").unpack1("D")
really_rand()
really_rand()
=> More informations about this toot | More toots from john@hawthorn.pub
@john cursed crypto. can you explain what’s going on there?
=> More informations about this toot | More toots from akahn@mastodon.social
@akahn For testing I needed to generate random floating point numbers from -infinity to infinity (rand() just gives 0.0 to 1.0). This generates random 64 bit integers and then reinterprets their bytes as a double.
=> More informations about this toot | More toots from john@hawthorn.pub This content has been proxied by September (3851b).Proxy Information
text/gemini