Click here to Skip to main content
15,887,821 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get value 1.3 from a float value 1.333333 Pin
Cedric Moonen20-Feb-11 21:21
Cedric Moonen20-Feb-11 21:21 
AnswerRe: How to get value 1.3 from a float value 1.333333 Pin
Andrew Brock20-Feb-11 22:02
Andrew Brock20-Feb-11 22:02 
GeneralRe: How to get value 1.3 from a float value 1.333333 Pin
Niklas L20-Feb-11 22:19
Niklas L20-Feb-11 22:19 
GeneralRe: How to get value 1.3 from a float value 1.333333 Pin
Alain Rist20-Feb-11 22:30
Alain Rist20-Feb-11 22:30 
JokeRe: How to get value 1.3 from a float value 1.333333 Pin
Niklas L20-Feb-11 23:01
Niklas L20-Feb-11 23:01 
GeneralRe: How to get value 1.3 from a float value 1.333333 Pin
Rick York22-Feb-11 22:17
mveRick York22-Feb-11 22:17 
GeneralRe: How to get value 1.3 from a float value 1.333333 Pin
Andrew Brock23-Feb-11 0:40
Andrew Brock23-Feb-11 0:40 
GeneralRe: How to get value 1.3 from a float value 1.333333 Pin
Rick York23-Feb-11 8:08
mveRick York23-Feb-11 8:08 
I can understand that - to a point. If you are that concerned with performance there are a lot of other techniques you can use to get big gains in performance. One simple example : if a complex expression or calculation is repeated then save the result in a temporary variable. I have lost count of how many times I have seen people repeat expressions in code. Not only will this have higher performance it will also help maintenance and that is one of my highest priorities. It is been frequently stated that software usually spends more time undergoing maintenance than it does being developed and in my experience this is very true so I believe in making software as maintainable as possible and clarity is very important for this.

One more thing - as you said before, the compiler will convert to multiplies automatically when it can so, to me, it makes no sense to sacrifice clarity for something that is done for you transparently. In fact, I find it completely ridiculous but opinions vary.
GeneralRe: How to get value 1.3 from a float value 1.333333 Pin
Stefan_Lang23-Feb-11 1:50
Stefan_Lang23-Feb-11 1:50 
GeneralRe: How to get value 1.3 from a float value 1.333333 Pin
Rick York23-Feb-11 8:01
mveRick York23-Feb-11 8:01 
AnswerRe: How to get value 1.3 from a float value 1.333333 Pin
Richard MacCutchan21-Feb-11 0:40
mveRichard MacCutchan21-Feb-11 0:40 
QuestionMultiplication from int value to float value is not giving proper result. Pin
Amrit Agr20-Feb-11 16:34
Amrit Agr20-Feb-11 16:34 
AnswerRe: Multiplication from int value to float value is not giving proper result. Pin
tagopi20-Feb-11 17:16
tagopi20-Feb-11 17:16 
AnswerRe: Multiplication from int value to float value is not giving proper result. Pin
Richard MacCutchan21-Feb-11 0:38
mveRichard MacCutchan21-Feb-11 0:38 
QuestionHow to use Windows forms in unmanaged C++ Pin
Danzy8320-Feb-11 14:12
Danzy8320-Feb-11 14:12 
AnswerRe: How to use Windows forms in unmanaged C++ Pin
csrss20-Feb-11 14:52
csrss20-Feb-11 14:52 
GeneralRe: How to use Windows forms in unmanaged C++ Pin
Danzy8321-Feb-11 1:14
Danzy8321-Feb-11 1:14 
GeneralRe: How to use Windows forms in unmanaged C++ Pin
_AnsHUMAN_ 21-Feb-11 1:49
_AnsHUMAN_ 21-Feb-11 1:49 
QuestionTrackPopupMenu question Pin
csrss19-Feb-11 5:07
csrss19-Feb-11 5:07 
AnswerRe: TrackPopupMenu question Pin
Code-o-mat19-Feb-11 5:24
Code-o-mat19-Feb-11 5:24 
GeneralRe: TrackPopupMenu question Pin
csrss19-Feb-11 5:38
csrss19-Feb-11 5:38 
GeneralRe: TrackPopupMenu question Pin
Code-o-mat19-Feb-11 5:45
Code-o-mat19-Feb-11 5:45 
GeneralRe: TrackPopupMenu question Pin
Niklas L20-Feb-11 20:28
Niklas L20-Feb-11 20:28 
QuestionScroll Bar in CEdit (GetScrollBarCtrl) Pin
Shivanand Gupta19-Feb-11 4:41
Shivanand Gupta19-Feb-11 4:41 
AnswerRe: Scroll Bar in CEdit (GetScrollBarCtrl) Pin
Hans Dietrich19-Feb-11 6:07
mentorHans Dietrich19-Feb-11 6:07 

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.