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

C / C++ / MFC

 
AnswerRe: C++ Directory Functions Pin
krmed21-Apr-09 3:03
krmed21-Apr-09 3:03 
QuestionWhat I should Use...bitset, vector &LT bool&GT, or bit_vector? Pin
JohnnyG20-Apr-09 13:51
JohnnyG20-Apr-09 13:51 
AnswerRe: What I should Use...bitset, vector &LT bool&GT, or bit_vector? Pin
Stuart Dootson20-Apr-09 20:07
professionalStuart Dootson20-Apr-09 20:07 
GeneralRe: What I should Use...bitset, vector &LT bool&GT, or bit_vector? Pin
JohnnyG21-Apr-09 11:18
JohnnyG21-Apr-09 11:18 
Questionsprintf and rounding issues [modified] Pin
Jim Crafton20-Apr-09 8:27
Jim Crafton20-Apr-09 8:27 
AnswerRe: sprintf and rounding issues Pin
Stuart Dootson20-Apr-09 8:57
professionalStuart Dootson20-Apr-09 8:57 
AnswerRe: sprintf and rounding issues Pin
Luc Pattyn20-Apr-09 9:20
sitebuilderLuc Pattyn20-Apr-09 9:20 
AnswerRe: sprintf and rounding issues Pin
CPallini20-Apr-09 10:38
mveCPallini20-Apr-09 10:38 
Follow me into the IEEE journey (i.e. mere experimenal evidence of Luc's argument), check out the hexadecimal representation of the numbers:
40 20 c6 66 66 66 66 66
40 22 79 99 99 99 99 9a

From [^] we know that:
sign, for both number is 0, hence they are positive (what surprise!).

Exponent is 0x402 for both numbers, i.e. 1026, i.e. 3, since the IEEE standard biases the exponents of 1023.

Now the important part, the fraction:
First number has 0x0c66666666666 * 2^-52, i.e. 0.048437499999999911182158029987477 (windows calculator is great!). following the IEEE prescription we add the implicit 1 obtaining 1.048437499999999911182158029987477.

Second number has 0x279999999999a * 2^-52, i.e. 0.15468750000000008881784197001252. Adding the implicit 1 makes 1.15468750000000008881784197001252.

Finally we get 1.048437499999999911182158029987477 * 2^3 = 8.3874999999999992894572642398998 (first number), 1.15468750000000008881784197001252 * 2^3 = 9.2375000000000007105427357601002 hence follows the 'strange printf behaviour'.

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

QuestionText in OpenGL Pin
yousuf_227920-Apr-09 8:12
professionalyousuf_227920-Apr-09 8:12 
AnswerRe: Text in OpenGL Pin
Stuart Dootson20-Apr-09 8:24
professionalStuart Dootson20-Apr-09 8:24 
GeneralRe: Text in OpenGL Pin
yousuf_227920-Apr-09 8:31
professionalyousuf_227920-Apr-09 8:31 
GeneralRe: Text in OpenGL Pin
yousuf_227920-Apr-09 8:34
professionalyousuf_227920-Apr-09 8:34 
GeneralRe: Text in OpenGL Pin
Stuart Dootson20-Apr-09 8:43
professionalStuart Dootson20-Apr-09 8:43 
QuestionHeap Memory / COM Object Limits Pin
Steve Thresher20-Apr-09 6:50
Steve Thresher20-Apr-09 6:50 
QuestionExecuting Code on C++ API Exit Pin
turkmeistr120-Apr-09 5:53
turkmeistr120-Apr-09 5:53 
QuestionRe: Executing Code on C++ API Exit Pin
David Crow20-Apr-09 5:57
David Crow20-Apr-09 5:57 
AnswerRe: Executing Code on C++ API Exit Pin
turkmeistr120-Apr-09 6:23
turkmeistr120-Apr-09 6:23 
GeneralRe: Executing Code on C++ API Exit Pin
David Crow20-Apr-09 8:07
David Crow20-Apr-09 8:07 
GeneralRe: Executing Code on C++ API Exit Pin
turkmeistr120-Apr-09 9:07
turkmeistr120-Apr-09 9:07 
Questionchar array issues Pin
gamefreak229120-Apr-09 5:07
gamefreak229120-Apr-09 5:07 
QuestionRe: char array issues Pin
David Crow20-Apr-09 5:15
David Crow20-Apr-09 5:15 
AnswerRe: char array issues Pin
gamefreak229120-Apr-09 6:02
gamefreak229120-Apr-09 6:02 
GeneralRe: char array issues PinPopular
Maximilien20-Apr-09 6:51
Maximilien20-Apr-09 6:51 
AnswerRe: char array issues Pin
CPallini20-Apr-09 10:51
mveCPallini20-Apr-09 10:51 
AnswerRe: char array issues Pin
Stuart Dootson20-Apr-09 19:41
professionalStuart Dootson20-Apr-09 19:41 

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.