yes...It works
Thanks for all.
Writing my own OS
Moderator:Moderators
Hi;
when I write:
it displays a huge random No.
I think the problem in the DebugDisplay.cpp:
plz help me to display many digits Number!
when I write:
Code: Select all
DebugPrintf ("\n precision %d",3.75);
I think the problem in the DebugDisplay.cpp:
Code: Select all
int DebugPrintf (const char* str, ...)
/*** integers ***/
case 'd':
case 'i': {
int c = va_arg (args, int);
char str[32]={0};
itoa_s (c, 10, str);
DebugPuts (str);
i++; // go to next character
break;
}
Having not seeing this really large number, I am willing to bet that it's 1081081856
Am I right?
Here is how I made my guess:
You are passing a parameter of 3.75, which is a floating point value. Your DebugPrintf is interpreting it as an integer.
Because a computer can only deal with integers, it has no idea about floating points. Therefore, there exits the IEEE 754 standard for representing floating point values as integers.
http://en.wikipedia.org/wiki/Floating_p ... esentation has more information about the specific format of floating point numbers.
Enjoy
~Andrew
Am I right?
Here is how I made my guess:
You are passing a parameter of 3.75, which is a floating point value. Your DebugPrintf is interpreting it as an integer.
Because a computer can only deal with integers, it has no idea about floating points. Therefore, there exits the IEEE 754 standard for representing floating point values as integers.
http://en.wikipedia.org/wiki/Floating_p ... esentation has more information about the specific format of floating point numbers.
Enjoy
~Andrew