Xref: utzoo comp.lang.c:36188 comp.lang.c++:11680 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ub!acsu.buffalo.edu From: hinkle@acsu.buffalo.edu (steven j hinkle) Newsgroups: sunyab.tutorial,comp.lang.c,comp.lang.c++ Subject: Truncating a double float Message-ID: <60278@eerie.acsu.Buffalo.EDU> Date: 17 Feb 91 20:14:53 GMT Sender: news@acsu.Buffalo.EDU Followup-To: sunyab.tutorial Distribution: usa Organization: SUNY Buffalo Lines: 18 Nntp-Posting-Host: autarch.acsu.buffalo.edu 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@acsu.buffalo.edu | light bulb, it is probably | | BITNET : hinkle@sunybcs | burned out. |