skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

tain_add.c (265B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/tai.h>
      4 
      5 int tain_add (tain *t, tain const *u, tain const *v)
      6 {
      7   t->sec.x = u->sec.x + v->sec.x ;
      8   t->nano = u->nano + v->nano ;
      9   if (t->nano > 999999999U)
     10   {
     11     t->sec.x++ ;
     12     t->nano -= 1000000000U ;
     13   }
     14   return 1 ;
     15 }