Click here to Skip to main content
15,921,542 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralConversion.. Pin
Neha25-Jun-03 21:22
Neha25-Jun-03 21:22 
GeneralRe: Conversion.. Pin
Ted Ferenc25-Jun-03 21:48
Ted Ferenc25-Jun-03 21:48 
GeneralRe: Conversion.. Pin
Neha25-Jun-03 21:58
Neha25-Jun-03 21:58 
GeneralRe: Conversion.. Pin
peterchen25-Jun-03 22:11
peterchen25-Jun-03 22:11 
GeneralRe: Conversion.. Pin
Ted Ferenc26-Jun-03 0:38
Ted Ferenc26-Jun-03 0:38 
GeneralRe: Conversion.. Pin
peterchen26-Jun-03 9:11
peterchen26-Jun-03 9:11 
GeneralRe: Conversion.. Pin
Ryan Binns26-Jun-03 0:50
Ryan Binns26-Jun-03 0:50 
GeneralRe: Conversion.. Pin
Anonymous26-Jun-03 2:14
Anonymous26-Jun-03 2:14 
Ryan Binns wrote:
double result = floor((x+0.005)*100.0)/100.0;

This won't work if x is negative. Usually when I am need to such a thing, I need to do it more than once so I just call one of my own functions to do this : eg

double RoundDecPlace( double dNumberIn, int nDecPlace )<br />
{<br />
	double dMultiplier = 10 ^ nDecPlace;<br />
	double dDiff = 0.5 / dMultiplier;<br />
	double dSign = ( dNumberIn >= 0.0 ) ? +1.0 : -1.0;<br />
<br />
	return dSign * floor( ( dSign * dNumberIn + dDiff ) * dMultiplier ) / dMultiplier;<br />
}<br />

GeneralRe: Conversion.. Pin
Ryan Binns26-Jun-03 2:22
Ryan Binns26-Jun-03 2:22 
GeneralRe: Conversion.. Pin
Anonymous26-Jun-03 6:10
Anonymous26-Jun-03 6:10 
GeneralRe: Conversion.. Pin
basementman26-Jun-03 6:42
basementman26-Jun-03 6:42 
GeneralI have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
kydfru25-Jun-03 20:37
kydfru25-Jun-03 20:37 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
Ryan Binns26-Jun-03 0:56
Ryan Binns26-Jun-03 0:56 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
kydfru26-Jun-03 1:27
kydfru26-Jun-03 1:27 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
Ryan Binns26-Jun-03 1:49
Ryan Binns26-Jun-03 1:49 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
wheregone26-Jun-03 1:52
wheregone26-Jun-03 1:52 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
kydfru26-Jun-03 2:26
kydfru26-Jun-03 2:26 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
wheregone26-Jun-03 5:27
wheregone26-Jun-03 5:27 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
kydfru26-Jun-03 7:28
kydfru26-Jun-03 7:28 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
wheregone26-Jun-03 14:22
wheregone26-Jun-03 14:22 
QuestionHow to determine whether a file is an executable by examining the file extension? Pin
dandy7725-Jun-03 20:28
dandy7725-Jun-03 20:28 
AnswerRe: How to determine whether a file is an executable by examining the file extension? Pin
Toni7825-Jun-03 21:56
Toni7825-Jun-03 21:56 
GeneralRe: How to determine whether a file is an executable by examining the file extension? Pin
dandy7725-Jun-03 22:20
dandy7725-Jun-03 22:20 
GeneralRe: How to determine whether a file is an executable by examining the file extension? Pin
Toni7826-Jun-03 21:23
Toni7826-Jun-03 21:23 
AnswerRe: How to determine whether a file is an executable by examining the file extension? Pin
Joaquín M López Muñoz25-Jun-03 23:14
Joaquín M López Muñoz25-Jun-03 23:14 

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.