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

Ken Bloom kbloom at gmail.com
Thu Feb 16 12:08:25 PST 2006


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.

Likewise for shorts and ints.

--Ken

-- 
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://ns1.livepenguin.com/pipermail/vox-tech/attachments/20060216/08ddca05/attachment.pgp


More information about the vox-tech mailing list