When to use a Float

Short answer: You only have to use a float when you know exactly what you’re doing and why.

Long answer: floats (as opposed to doubles) aren’t really used anymore outside 3D APIs as far as I know. Floats and doubles have the same performance characteristics on modern CPUs, doubles are somewhat bigger and that’s all. If in doubt, just use double.

Oh yes, and use decimal for financial calculations, of course.

Leave a Comment