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

#include <skalibs/tai.h>

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