home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!web-3c.berkeley.edu!c60b-3hu
- From: c60b-3hu@web-3c.berkeley.edu (Paul Hsu)
- Newsgroups: comp.lang.c
- Subject: speed? double vs. float. math.h??
- Date: 26 Dec 1992 09:17:53 GMT
- Organization: University of California, Berkeley
- Lines: 14
- Distribution: world
- Message-ID: <1hh801INNab1@agate.berkeley.edu>
- NNTP-Posting-Host: web-3c.berkeley.edu
- Originator: c60b-3hu@web-3c.berkeley.edu
-
-
- I'm currently writing a C program where it needs to do lots and lots of
- trig calculations. But I would like the program to run really really fast.
- So I'm concerned about the speed at which the calculations are carried out.
- Trying to make the program run fast, I would like to have only float
- variables, instead of doubles, in my program. But in the standard math
- library, all the functions take in arguments and return values in the type
- double. So, what should I do? First of all, should I even be concerned
- about the speed difference between doing calculations in float and doing the
- calculations in doubles? If yes, how should I go about in making the math
- functions to accept and return floats? Casting them won't help.... it'll
- only take more time in the type conversion. Any suggestion?
-
- Paul.
-