I'm designing a DOF calculator. Looking at other calculators, I can see that some of them use rounded values (e.g. f/2.8) and some use exact values derived from the square root calculation (e.g. f/2.828). My assumption is that the rounded value calculators are just being lazy but I just wanted to make sure there wasn't actually some reason why they do it?
F# is only accurate when focused at infinity, because the lens' stated focal length is only accurate when focused at infinity.
Combine that with rounded focal lengths and F#'s, that DoF and hyperfocus (in particular) are about not focusing at infinity, and the fact that DoF isn't a fixed aspect of an image (especially if the composition will be changed in post), makes DoF calculators about useless... there's no point in worrying about a few hundredths of F#.
As any DoF definition is based on some "arbitrary" limit for the diameter of the circle of diffusion, it will only ever be a rough indicator.
It's not the case that inside the DoF, everything is perfectly sharp, and exactly at the DoF border it immediately becomes unsharp, it's a continuous degradation.
So, what limit will you apply?
- 10µm or 30µm? These two values will make a clearly visible difference.
- 10µm or 11µm? I doubt that anyone will notice a difference in sharpness.
- 10µm or 10.1µm? That surely doesn't matter.
So, as long as your inaccuracies don't exceed 10% or even 20%, it doesn't matter in practice. So, forget about the 1% difference between 2.8 and 2.828.
But, if you want to do a really useful DoF calculator, I'd recommend to include diffraction effects. We all know that after some f-stop, further closing of the aperture makes sharpness degrade, so that the expected increase in DoF turns into an image where nothing is really sharp.