summaryrefslogtreecommitdiff
path: root/src/libstddjb/tain_half.c
blob: 8d3e199974f40ce6cee739056bab7db5ef71edd0 (plain)
1
2
3
4
5
6
7
8
9
10
/* ISC license. */

#include <skalibs/tai.h>

void tain_half (tain *t, tain const *u)
{
  t->nano = u->nano >> 1 ;
  if (u->sec.x & 1) t->nano += 500000000U ;
  t->sec.x = u->sec.x >> 1 ;
}