Comment

Comment by bjoli

Wouldn't it be better multiplying the total of the choices with a random double. That way the random double is always strictly below total and the user isn't bitten by dumb float addition errors?

The only error then is when there are no choices or they set the weights to 0, negative or NaN. I am but a lowly musician though. I can't say I always think floats are simple...

parent bjoli 24 days ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton