Click here to Skip to main content
15,912,665 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralShow macro code expanded in Visual Studio Pin
Aaron Schaefer11-Feb-03 8:21
Aaron Schaefer11-Feb-03 8:21 
GeneralRe: Show macro code expanded in Visual Studio Pin
Michael Dunn11-Feb-03 8:28
sitebuilderMichael Dunn11-Feb-03 8:28 
Generalround off problem Pin
wong190711-Feb-03 8:14
wong190711-Feb-03 8:14 
GeneralRe: round off problem Pin
Rickard Andersson2011-Feb-03 8:27
Rickard Andersson2011-Feb-03 8:27 
GeneralRe: round off problem Pin
PJ Arends11-Feb-03 8:35
professionalPJ Arends11-Feb-03 8:35 
GeneralRe: round off problem Pin
PJ Arends11-Feb-03 8:31
professionalPJ Arends11-Feb-03 8:31 
GeneralRe: round off problem Pin
Chris Losinger11-Feb-03 9:36
professionalChris Losinger11-Feb-03 9:36 
GeneralRe: round off problem Pin
David Chamberlain11-Feb-03 9:00
David Chamberlain11-Feb-03 9:00 
It's a little more complicated if you are going to be dealing with both positive and negative numbers, as the floor() function moves the decimal number toward zero and the ceil() function moves the decimal number away from zero. The value of floor(-23.7) is -23, where rounded you probably would want -24. Adding 0.5 to the value before casting to an int works only for positive values, and not for negatives. There, you would have to subtract.

floor(-23.7 - 0.5) = floor(-24.2) = 24<br />
floor( 23.7 + 0.5) = floor( 24.2) = 24


Dave

"You can say that again." -- Dept. of Redundancy Dept.
GeneralI subclassed a CStatic... Pin
User 988511-Feb-03 8:04
User 988511-Feb-03 8:04 
GeneralRe: I subclassed a CStatic... Pin
palbano11-Feb-03 8:17
palbano11-Feb-03 8:17 
GeneralRe: I subclassed a CStatic... Pin
User 988511-Feb-03 8:21
User 988511-Feb-03 8:21 
GeneralRe: I subclassed a CStatic... Pin
palbano11-Feb-03 9:10
palbano11-Feb-03 9:10 
GeneralRe: I subclassed a CStatic... Pin
User 988511-Feb-03 8:23
User 988511-Feb-03 8:23 
GeneralRe: I subclassed a CStatic... Pin
palbano11-Feb-03 8:34
palbano11-Feb-03 8:34 
GeneralRe: I subclassed a CStatic... Pin
User 988511-Feb-03 8:41
User 988511-Feb-03 8:41 
GeneralRe: I subclassed a CStatic... Pin
User 988511-Feb-03 9:09
User 988511-Feb-03 9:09 
GeneralRe: I subclassed a CStatic... Pin
palbano11-Feb-03 10:33
palbano11-Feb-03 10:33 
GeneralRe: I subclassed a CStatic... Pin
Oliver Anhuth11-Feb-03 23:33
Oliver Anhuth11-Feb-03 23:33 
GeneralListBox Question (non-MFC) Pin
Paddy11-Feb-03 8:01
Paddy11-Feb-03 8:01 
GeneralRe: ListBox Question (non-MFC) Pin
Dominik Reichl11-Feb-03 8:17
Dominik Reichl11-Feb-03 8:17 
GeneralRe: ListBox Question (non-MFC) Pin
palbano11-Feb-03 8:23
palbano11-Feb-03 8:23 
GeneralRe: ListBox Question (non-MFC) Pin
Paddy11-Feb-03 9:47
Paddy11-Feb-03 9:47 
GeneralRe: ListBox Question (non-MFC) Pin
Paddy11-Feb-03 9:36
Paddy11-Feb-03 9:36 
GeneralDebug Tracing into MFC classes Pin
Daniel Kamisnki11-Feb-03 7:20
Daniel Kamisnki11-Feb-03 7:20 
GeneralRe: Debug Tracing into MFC classes Pin
palbano11-Feb-03 7:30
palbano11-Feb-03 7:30 

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.