C/C++ Windows API

Moderators: Lundin
Number of threads: 443
Number of posts: 1215

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: Win32 MAth Error Double to Int Conversion Posted by AsmGuru62 on 14 Oct 2008 at 5:16 AM

I'll try your code in VS 2005. I see the double is 8 bytes in DEV C++. In FASM the memory dump at 'p' will be this one:

;
; Value 46.0 as 8 bytes double
;
00 00 00 00 00 00 47 40


Try to dump it like this:

double a = 46.0;
unsigned char* p = (unsigned char*) &a;
char s [32];
char* pdump = s;

for (int i=0; i<8; i++)
{
    wsprintfA (pdump, "%02X ", p[i]);
    pdump += 3;
}

// At this point look on buffer 's' in debugger
Thread Tree
Ed Hall Win32 MAth Error Double to Int Conversion on 12 Oct 2008 at 1:48 PM
AsmGuru62 Re: Win32 MAth Error Double to Int Conversion on 13 Oct 2008 at 4:38 AM
Ed Hall Re: Win32 MAth Error Double to Int Conversion on 13 Oct 2008 at 9:39 AM
Ed Hall Re: Win32 MAth Error Double to Int Conversion on 13 Oct 2008 at 11:37 AM
BitByBit_Thor Re: Win32 MAth Error Double to Int Conversion on 13 Oct 2008 at 5:10 PM
AsmGuru62 Re: Win32 MAth Error Double to Int Conversion on 14 Oct 2008 at 5:16 AM
Ed Hall Re: Win32 MAth Error Double to Int Conversion on 14 Oct 2008 at 6:15 PM
AsmGuru62 Re: Win32 MAth Error Double to Int Conversion on 15 Oct 2008 at 4:20 AM
Ed Hall Re: Win32 MAth Error Double to Int Conversion on 15 Oct 2008 at 7:36 AM
AsmGuru62 Re: Win32 MAth Error Double to Int Conversion on 15 Oct 2008 at 7:43 PM
Ed Hall Re: Win32 MAth Error Double to Int Conversion on 16 Oct 2008 at 7:05 AM
Lundin Re: Win32 MAth Error Double to Int Conversion on 16 Oct 2008 at 1:27 PM
AsmGuru62 Re: Win32 MAth Error Double to Int Conversion on 17 Oct 2008 at 3:54 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.