You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/11/27 08:30:40 UTC

[GitHub] [incubator-doris] marising edited a comment on issue #2274: Support more column type change

marising edited a comment on issue #2274: Support more column type change
URL: https://github.com/apache/incubator-doris/issues/2274#issuecomment-558981844
 
 
   http://www.softelectro.ru/ieee754_en.html
   According to the definition of IEEE754, the effect of converting a float binary to a double binary is the same as that of static_cast <double>. Data precision cannot be guaranteed, but the progress of decimal system can be guaranteed by converting a float binary to a char buffer and then to a double.
   
   ==System==
   float 0.3000000 is:             0 | 01111101 | 00110011001100110011010
   double 0.300000000000000 is:    0 | 01111111101 | 0011001100110011001100110011001100110011001100110011
   ==Convert Binary==
   float 0.3000000 is:             0 | 01111101 | 00110011001100110011010
   double 0.300000011920929 is:    0 | 01111111101 | 0000000000000000000001000000000000000000000000000000
   ==float to char to strtod==
   float 0.3000000 is:             0 | 01111101 | 00110011001100110011010
   double 0.300000000000000 is:    0 | 01111111101 | 0011001100110011001100110011001100110011001100110011
   ==static cast==
   float 0.3000000 is:             0 | 01111101 | 00110011001100110011010
   double 0.300000011920929 is:    0 | 01111111101 | 0000000000000000000001000000000000000000000000000000
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org