Click here to Skip to main content
16,011,482 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to hide a public function inherit from base class Pin
Dracula Wang2-Jul-08 21:27
Dracula Wang2-Jul-08 21:27 
QuestionRe: How to hide a public function inherit from base class Pin
CPallini2-Jul-08 21:36
mveCPallini2-Jul-08 21:36 
AnswerRe: How to hide a public function inherit from base class Pin
Dracula Wang2-Jul-08 21:50
Dracula Wang2-Jul-08 21:50 
QuestionRe: How to hide a public function inherit from base class Pin
CPallini2-Jul-08 21:56
mveCPallini2-Jul-08 21:56 
AnswerRe: How to hide a public function inherit from base class Pin
Dracula Wang2-Jul-08 22:05
Dracula Wang2-Jul-08 22:05 
AnswerRe: How to hide a public function inherit from base class Pin
BadKarma3-Jul-08 1:21
BadKarma3-Jul-08 1:21 
QuestionFloating point assembler code [modified] Pin
Tomerland2-Jul-08 20:56
Tomerland2-Jul-08 20:56 
AnswerRe: Floating point assembler code Pin
Roger Stoltz3-Jul-08 2:09
Roger Stoltz3-Jul-08 2:09 
Tomerland wrote:
All variables are floating point. This line is excecuted millions of times.
Now I think about improving runtime by using inline-assembler.


I would recommend you to not use inline-asm for various reasons, but the primary reason is "there must be a better way".

A few things to reflect upon:

1. Floating point instructions are slow.
Does it have to be floating points or would integer values suffice?

2. Updating an array of floating points is rarely a "bottleneck" from a data administration point of view. You rarely take time critical actions based upon floating point calculation with e.g. 15-bit exponent and a 64-bit mantissa which is what you have when using long double.
If you're doing this from your GUI thread it will become unresponsive and the user will experience the UI as hung, but that's another problem.
Is it not possible to calculate the new values of the array in a worker thread and post a message to the GUI thread when the calculation has finished?

3. How about using integers that are multiplied by e.g. 100?
When you calculate with the values you have two "decimals", but when you present the value to the user, or store it, you can convert to a floating point value.
I used this technique in an embedded system that had no support for floating point values, but I multiplied with 16 instead which was a good enough approximation.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


AnswerRe: Floating point assembler code Pin
Alan Balkany3-Jul-08 4:57
Alan Balkany3-Jul-08 4:57 
QuestionHow to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Chesnokov Yuriy2-Jul-08 20:55
professionalChesnokov Yuriy2-Jul-08 20:55 
AnswerRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Saurabh.Garg2-Jul-08 21:02
Saurabh.Garg2-Jul-08 21:02 
AnswerRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Chesnokov Yuriy2-Jul-08 21:33
professionalChesnokov Yuriy2-Jul-08 21:33 
GeneralRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Saurabh.Garg2-Jul-08 21:40
Saurabh.Garg2-Jul-08 21:40 
QuestionRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Chesnokov Yuriy2-Jul-08 21:49
professionalChesnokov Yuriy2-Jul-08 21:49 
AnswerRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Saurabh.Garg2-Jul-08 22:10
Saurabh.Garg2-Jul-08 22:10 
QuestionRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Chesnokov Yuriy2-Jul-08 22:31
professionalChesnokov Yuriy2-Jul-08 22:31 
AnswerRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Chesnokov Yuriy2-Jul-08 21:42
professionalChesnokov Yuriy2-Jul-08 21:42 
AnswerRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Stephen Hewitt2-Jul-08 21:10
Stephen Hewitt2-Jul-08 21:10 
GeneralRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Chesnokov Yuriy2-Jul-08 21:36
professionalChesnokov Yuriy2-Jul-08 21:36 
GeneralRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Stephen Hewitt2-Jul-08 21:51
Stephen Hewitt2-Jul-08 21:51 
QuestionRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Chesnokov Yuriy2-Jul-08 22:04
professionalChesnokov Yuriy2-Jul-08 22:04 
AnswerRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Stephen Hewitt2-Jul-08 22:09
Stephen Hewitt2-Jul-08 22:09 
GeneralRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
CPallini2-Jul-08 22:19
mveCPallini2-Jul-08 22:19 
QuestionRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Chesnokov Yuriy2-Jul-08 22:34
professionalChesnokov Yuriy2-Jul-08 22:34 
AnswerRe: How to struct AA{ struct BB; }; struct BB { struct AA; }; Pin
Stephen Hewitt2-Jul-08 22:37
Stephen Hewitt2-Jul-08 22:37 

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.