[vox-tech] float vs double, int vs short

Tim Riley timriley at appahost.com
Thu Feb 16 14:05:56 PST 2006




---------- Original Message ----------------------------------
From: Ken Bloom <kbloom at gmail.com>
Reply-To: "lugod's technical discussion forum" <vox-tech at lists.lugod.org>
Date:  Thu, 16 Feb 2006 14:08:25 -0600

>>
>>On Thu, Feb 16, 2006 at 11:21:11AM -0500, Peter Jay Salzman wrote:
>> I've been googling for the past 15 minutes and have read that:
>>
>>    * computations with doubles are always faster than floats
>>    * computations with doubles are often faster than floats
>>    * computations with floats are often faster than doubles
>>    * computations with floats are always faster than doubles
>>
>> The arguments I've read for all four cases seem reasonable.  I trust
>> the collective brains of lugod more than any internet forum.  What's
>> the real scoop on the relative speed of basic arithmetic operations
>> on floats and doubles?
>
>Write a simple benchmark and tell us. A program that runs the desired
>operations in a loop a few million times should give you a good idea
>which is faster.

Surprise! Double was 10% faster on 1 billion iterations of a
simple addition.
 


More information about the vox-tech mailing list