From: Joe Wright Newsgroups: comp.os.msdos.djgpp Subject: Re: doubles vs. floats Date: Wed, 29 Jan 1997 12:37:56 -0800 Organization: Alpha Solutions International Lines: 25 Message-ID: <32EFB524.37FA@exis.net> References: <32EEA01D DOT 700E AT bc DOT sympatico DOT ca> <5cnv9m$c6c AT waldorf DOT csc DOT calpoly DOT edu> Reply-To: wrightj AT exis DOT net NNTP-Posting-Host: ppp-5-145.exis.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Jan Louwerens wrote: > > Ryan Blazecka (eblazecka AT bc DOT sympatico DOT ca) wrote: > : Michael Phelps wrote: > > : > This may sound a little counterintuitive, but sometimes you can get better > : > results by using doubles rather than floats. > > : Why is this? I've heard it many times, but never understood why. > > Yes, this is true. It is because every float is is converted into a > double before every operation and is then converted back into a float at > the end of the operation. (FPU only handles double, not float? I'm not > sure). If you want speed, use all doubles instead of floats. For size, > use floats. > > JL Yes, it's true. double is better than float in every conceivable way. I don't even think the size argument has any validity unless you have a really massive number of them. Anyway, memory is cheaper than time. And double is significantly more accurate and precise. -- Joe Wright mailto:wrightj AT exis DOT net "Everything should be made as simple as possible, but not simpler." --Albert Einstein--