Home > Back-end >  The integer part of decimal fraction, certainly can be converted to binary, this also right?
The integer part of decimal fraction, certainly can be converted to binary, this also right?

Time:01-21

The integer part of decimal fraction, certainly can be converted to binary, this also right?

CodePudding user response:

Well, that's right, can be expressed in binary, specifically can use binary representation and storage, because the computer only know binary 1 s and 0 s, deny the other, so the computer knowledge and calculation can be used of 0 s and 1 s logo,

CodePudding user response:

Floating point Numbers is accuracy, is not necessarily can accurately converted to binary, for example:
Int main (void)
{
Float a=123456789.0 f;
STD: : cout & lt; }
Print the result: 123456792.000000
You see, the integer part of the transformed result is wrong,
  • Related