Click here to Skip to main content
15,895,423 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Class Wizard Pin
Christian Graus16-Jan-07 15:36
protectorChristian Graus16-Jan-07 15:36 
AnswerRe: Class Wizard Pin
prasad_som16-Jan-07 17:24
prasad_som16-Jan-07 17:24 
QuestionClient / Server Pin
Dosin16-Jan-07 14:21
Dosin16-Jan-07 14:21 
AnswerRe: Client / Server Pin
Mark Salsbery16-Jan-07 14:49
Mark Salsbery16-Jan-07 14:49 
GeneralRe: Client / Server Pin
Dosin16-Jan-07 16:14
Dosin16-Jan-07 16:14 
QuestionRe: Client / Server Pin
Rajesh R Subramanian16-Jan-07 19:28
professionalRajesh R Subramanian16-Jan-07 19:28 
Questiontype casting float to int/short Pin
acerunner31616-Jan-07 13:07
acerunner31616-Jan-07 13:07 
AnswerRe: type casting float to int/short Pin
Christian Graus16-Jan-07 13:17
protectorChristian Graus16-Jan-07 13:17 
A floating point value is never precise.  Sorry, that's how it goes.  Try including math.h and do this:

int tempint = (int )ceil(
tempflt*100);<br />
<br />
I think that's the right syntax, but the Math class has floor and ceiling methods, which round up and down.  This will round your 379.xxx up to 380.00, then you cast it to int.<br />


Christian Graus - C++ MVP

'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

GeneralRe: type casting float to int/short [modified] Pin
acerunner31616-Jan-07 13:29
acerunner31616-Jan-07 13:29 
GeneralRe: type casting float to int/short Pin
Christian Graus16-Jan-07 13:40
protectorChristian Graus16-Jan-07 13:40 
GeneralRe: type casting float to int/short Pin
acerunner31616-Jan-07 13:45
acerunner31616-Jan-07 13:45 
GeneralRe: type casting float to int/short Pin
Christian Graus16-Jan-07 15:37
protectorChristian Graus16-Jan-07 15:37 
AnswerRe: type casting float to int/short Pin
Rick York16-Jan-07 13:38
mveRick York16-Jan-07 13:38 
GeneralRe: type casting float to int/short Pin
acerunner31616-Jan-07 13:48
acerunner31616-Jan-07 13:48 
GeneralRe: type casting float to int/short Pin
Christian Graus16-Jan-07 15:37
protectorChristian Graus16-Jan-07 15:37 
AnswerRe: type casting float to int/short Pin
malaugh17-Jan-07 12:49
malaugh17-Jan-07 12:49 
QuestionDetermine an Interactive versus Terminal Services User Pin
Jeffrey Walton16-Jan-07 12:38
Jeffrey Walton16-Jan-07 12:38 
QuestionTechnique for edit "in place"? Modless dialogue? Pin
Dalfxxx16-Jan-07 11:49
Dalfxxx16-Jan-07 11:49 
AnswerRe: Technique for edit "in place"? Modless dialogue? Pin
Christian Graus16-Jan-07 13:18
protectorChristian Graus16-Jan-07 13:18 
GeneralRe: Technique for edit "in place"? Modless dialogue? Pin
Dalfxxx17-Jan-07 8:32
Dalfxxx17-Jan-07 8:32 
GeneralRe: Technique for edit "in place"? Modless dialogue? Pin
Christian Graus17-Jan-07 8:56
protectorChristian Graus17-Jan-07 8:56 
GeneralRe: Technique for edit "in place"? Modless dialogue? Pin
Dalfxxx17-Jan-07 12:05
Dalfxxx17-Jan-07 12:05 
GeneralRe: Technique for edit "in place"? Modless dialogue? Pin
Christian Graus17-Jan-07 17:16
protectorChristian Graus17-Jan-07 17:16 
AnswerRe: Technique for edit "in place"? Modless dialogue? Pin
Mark Salsbery16-Jan-07 13:19
Mark Salsbery16-Jan-07 13:19 
QuestionLIBPNG DLL with VS 2005 Pin
Bartosz Bien16-Jan-07 11:44
Bartosz Bien16-Jan-07 11:44 

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.