Path: utzoo!mnetor!tmsoft!dptcdc!berner!lethe!geac!jtsv16!uunet!lll-winken!ames!sgi!tarolli@dragon.SGI.COM From: tarolli@dragon.SGI.COM (Gary Tarolli) Newsgroups: comp.sys.sgi Subject: Re: float vs double Summary: cc -float Keywords: float double Message-ID: <31685@sgi.SGI.COM> Date: 1 May 89 14:41:05 GMT References: <8904281948.AA28223@cartier.dgp.toronto.edu> <31617@sgi.SGI.COM> Distribution: na Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 12 One thing to remember - even if you declare variables to be float, they are still passed as doubles and expressions are usually evaulated in double precision. To prevent expressions from being done in double prec. except where necessary, compile with -float. To pass arguments as floats, use ANSI templates (see gl.h for examples). Beware with templates - both the caller and callee have to be properly compiled with the template for things to work. I agree with the previous comment, that the time to do double prec. vs. single prec. is probably insignificant compared to the time it takes to do the memory accesses and conversions.