summaryrefslogtreecommitdiff
path: root/src/libstddjb/tain_add.c
blob: 2c0f98dea0779a0f48587c42ed345d00d10520ac (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, tain const *u, tain 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 ;
}