Alex Rivera | Logout

Float vs Double Performance

Asked 2009-01-06T18:09:05.763
99

I did some timing tests and also read some articles like this one (last comment), and it looks like in Release build, float and double values take the same amount of processing time.

How is this possible? When float is less precise and smaller compared to double values, how can the CLR get doubles into the same processing time?

Edit
Report

1 Answer

11

There are still some cases where floats are preferred however - with OpenGL coding for example it's far more common to use the GLFloat datatype (generally mapped directly to 16 bit float) as it is more efficient on most GPUs than GLDouble.

answered 2009-01-06T18:20:13.463

Your Answer