suitcase

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

taia_fmtfrac.c (799B)


      1 #include <tai/taia.h>
      2 
      3 unsigned int taia_fmtfrac(char *s, struct taia *t)
      4 {
      5   unsigned long x;
      6 
      7   if (s) {
      8     x = t->atto;
      9     s[17] = '0' + (x % 10); x /= 10;
     10     s[16] = '0' + (x % 10); x /= 10;
     11     s[15] = '0' + (x % 10); x /= 10;
     12     s[14] = '0' + (x % 10); x /= 10;
     13     s[13] = '0' + (x % 10); x /= 10;
     14     s[12] = '0' + (x % 10); x /= 10;
     15     s[11] = '0' + (x % 10); x /= 10;
     16     s[10] = '0' + (x % 10); x /= 10;
     17     s[9] = '0' + (x % 10);
     18     x = t->nano;
     19     s[8] = '0' + (x % 10); x /= 10;
     20     s[7] = '0' + (x % 10); x /= 10;
     21     s[6] = '0' + (x % 10); x /= 10;
     22     s[5] = '0' + (x % 10); x /= 10;
     23     s[4] = '0' + (x % 10); x /= 10;
     24     s[3] = '0' + (x % 10); x /= 10;
     25     s[2] = '0' + (x % 10); x /= 10;
     26     s[1] = '0' + (x % 10); x /= 10;
     27     s[0] = '0' + (x % 10);
     28   }
     29 
     30   return 18;
     31 }