Hacker News new | ask | show | jobs
by Dylan16807 1092 days ago
It depends on what math you're doing. Very often you're likely to find that a base number of 1e-6 makes you less likely to hit your exponent limits than a base number of 1.

1 is special in that half the positive floats are above it and half are below. That doesn't mean your use case wants half.

1 comments

Then would it be fair to say that if you don't know what calculations might be coming, all other things being equal, 1 is a good choice since it is "unbiased" in this sense?
It's perfectly fine, but because addition is very common it's unlikely to be optimal.