Truncating a double float

steven j hinkle hinkle at acsu.buffalo.edu
Mon Feb 18 07:14:53 AEST 1991


   I would like to know if there is a good, "clean" way to truncate
a double float in C to a certain (given) accuracy point. 

   Example : I want to truncate a double to the tenth decimal point.

Anyone got a good idea how I can do this so that my code is portable?

Any help would be appreciated.

Steven Hinkle


-- 
|  Steven Hinkle   "The Quaker"       |  Always look on the bright side.|
|  University of Buffalo              |  If there isn't one, check the  |
|  INTERNET : hinkle at acsu.buffalo.edu |  light bulb, it is probably     |
|  BITNET   : hinkle at sunybcs          |  burned out.                    |



More information about the Comp.lang.c mailing list