suitcase

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

taia_half.c (278B)


      1 #include <tai/taia.h>
      2 
      3 /* XXX: breaks tai encapsulation */
      4 
      5 void taia_half(struct taia *t, struct taia *u)
      6 {
      7   t->atto = u->atto >> 1;
      8   if (u->nano & 1) t->atto += 500000000UL;
      9   t->nano = u->nano >> 1;
     10   if (u->sec.x & 1) t->nano += 500000000UL;
     11   t->sec.x = u->sec.x >> 1;
     12 }