Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * [atw] multiply 64 bit accumulator by 10 and add digit.
  3.  * The KA/CA way to do this should be to use
  4.  * a 64-bit integer internally and use "adjust" to
  5.  * convert it to float at the end of processing.
  6.  */
  7.  
  8. #include <_ansi.h>
  9. #include "std.h"
  10.  
  11. int
  12. _DEFUN (__ten_mul, (acc, digit),
  13.         double *acc _AND
  14.         int digit)
  15. {
  16.   /*
  17.    * [atw] Crude, but effective (at least on a KB)...
  18.    */
  19.  
  20.   *acc *= 10;
  21.   *acc += digit;
  22.  
  23.   return 0;                     /* no overflow */
  24. }
  25.