comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: About the bits reserved for float variable
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: About the bits reserved for float variable [message #39498 is a reply to message #39497] Fri, 21 May 2004 15:22 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.1b17c91c4c958ba1989761@news.frii.com>,
David Fanning <davidf@dfanning.com> wrote:

> it this way, you can have fast or accurate, but you
> can't have both. That's about as much as I've ever
> needed to know using a computer. :-)

It used to be that integer arithmetic was faster than floating point,
but that is generally no longer the case. Just about all machines
that I know of can do integer or floating point ops in a single
clock cycle. Some cpus can do more than one op per clock cycle.
(That's what many of those millions of transistors on
modern cpus are used for.)

Additionally, many (but not all) architectures have double-precision
floating point hardware units. DP operations on those systems are as fast as
single precision. On many machines the only drawbacks to doing everything
in DP are: twice as much memory is required and twice as much file
space.

My rules of thumb:
Use integers for things you can count (i.e., no fractions).
Use doubles for "real numbers", unless memory is a problem.
Write files in single or double precision, as needed.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: 3D plot of set of curves
Next Topic: Re: Depth visibility with Object Graphics !!!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:10:50 PDT 2025

Total time taken to generate the page: 0.72091 seconds