summaryrefslogtreecommitdiff
path: root/src/libstddjb/tain_add.c
blob: b119270c2dae75ac79be57e647d10e1114e958a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#include <skalibs/tai.h>

int tain_add (tain_t *t, tain_t const *u, tain_t const *v)
{
  t->sec.x = u->sec.x + v->sec.x ;
  t->nano = u->nano + v->nano ;
  if (t->nano > 999999999U)
  {
    t->sec.x++ ;
    t->nano -= 1000000000U ;
  }
  return 1 ;
}