Click here to Skip to main content
16,005,178 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: editing read-only files Pin
jhwurmbach14-Feb-07 3:21
jhwurmbach14-Feb-07 3:21 
QuestionBItmap trail Pin
ceejeeb14-Feb-07 2:23
ceejeeb14-Feb-07 2:23 
QuestionRounding numbers (both ways) Pin
Johpoke14-Feb-07 1:35
Johpoke14-Feb-07 1:35 
AnswerRe: Rounding numbers (both ways) Pin
jhwurmbach14-Feb-07 1:45
jhwurmbach14-Feb-07 1:45 
AnswerRe: Rounding numbers (both ways) Pin
toxcct14-Feb-07 2:03
toxcct14-Feb-07 2:03 
AnswerRe: Rounding numbers (both ways) Pin
David Crow14-Feb-07 2:21
David Crow14-Feb-07 2:21 
AnswerRe: Rounding numbers (both ways) Pin
-Dy14-Feb-07 2:21
-Dy14-Feb-07 2:21 
AnswerRe: Rounding numbers (both ways) Pin
#realJSOP14-Feb-07 10:25
professional#realJSOP14-Feb-07 10:25 
Well, that's not very "generic" (what happens when you need to round at a higher precision?).

double Rounder(double fVal, int nPrecision)
{
	nPrecision = __max(__min(16, nPrecision), 1);
	double fEpsilon = pow(10, nPrecision); 
	double fResult = ( floor(fVal * fEpsilon + 0.5) / fEpsilon);
}





"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


GeneralRe: Rounding numbers (both ways) Pin
Johpoke14-Feb-07 2:29
Johpoke14-Feb-07 2:29 
GeneralRe: Rounding numbers (both ways) Pin
toxcct14-Feb-07 2:30
toxcct14-Feb-07 2:30 
QuestionRe: Rounding numbers (both ways) Pin
Johpoke14-Feb-07 2:33
Johpoke14-Feb-07 2:33 
QuestionApplication Startup Pin
Robin Imrie14-Feb-07 1:22
professionalRobin Imrie14-Feb-07 1:22 
AnswerRe: Application Startup Pin
_AnsHUMAN_ 14-Feb-07 1:52
_AnsHUMAN_ 14-Feb-07 1:52 
GeneralRe: Application Startup Pin
Robin Imrie14-Feb-07 2:40
professionalRobin Imrie14-Feb-07 2:40 
QuestionRe: Application Startup Pin
David Crow14-Feb-07 2:22
David Crow14-Feb-07 2:22 
AnswerRe: Application Startup Pin
Robin Imrie14-Feb-07 2:44
professionalRobin Imrie14-Feb-07 2:44 
GeneralRe: Application Startup Pin
David Crow14-Feb-07 3:26
David Crow14-Feb-07 3:26 
GeneralRe: Application Startup Pin
Robin Imrie14-Feb-07 3:35
professionalRobin Imrie14-Feb-07 3:35 
QuestionRe: Application Startup Pin
David Crow14-Feb-07 3:53
David Crow14-Feb-07 3:53 
AnswerRe: Application Startup Pin
Robin Imrie14-Feb-07 4:08
professionalRobin Imrie14-Feb-07 4:08 
GeneralRe: Application Startup Pin
David Crow14-Feb-07 4:14
David Crow14-Feb-07 4:14 
GeneralRe: Application Startup Pin
Robin Imrie14-Feb-07 4:35
professionalRobin Imrie14-Feb-07 4:35 
GeneralRe: Application Startup Pin
David Crow14-Feb-07 4:43
David Crow14-Feb-07 4:43 
Questiondelete a directory Pin
sheetal_0614-Feb-07 1:10
sheetal_0614-Feb-07 1:10 
AnswerRe: delete a directory Pin
Naveen14-Feb-07 1:18
Naveen14-Feb-07 1:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.