SYNTAX

       #include <taia.h>

       double taia_approx(&t);
       double taia_frac(&t);
       void taia_tai(&t,&sec);

       int taia_less(&a,&b);
       void taia_add(&t,&a,&b);
       void taia_sub(&t,&a,&b);
       void taia_half(&t,&a);

       unsigned int taia_fmtfrac(s,&t);

       struct taia t;
       struct taia a;
       struct taia b;
       struct tai sec;
       char *s;


DESCRIPTION

       A  struct  taia  stores  an  integer between 0 inclusive and 2^64x10^18
       exclusive.  The format of struct taia is designed to  speed  up  common
       operations; applications should not look inside struct taia.

       A struct taia variable is commonly used to store a TAI64NA label.  Each
       TAI64NA  label  refers  to   one   attosecond   of   real   time;   see
       http://pobox.com/~djb/proto/tai64.txt  for more information.  The inte-
       ger in the struct taia is 10^18 times the second count, plus 10^9 times
       the nanosecond count, plus the attosecond count.

       A  struct taia variable may also be used to store the numerical differ-
       ence between two TAI64NA labels.


ARITHMETIC

       taia_approx returns a double-precision approximation to  t/10^18.   The
       result of taia_approx is always nonnegative.

       taia_tai places into sec the integer part of t/10^18.

       taia_frac returns a double-precision approximation to the fraction part
       of t/10^18.  The result of taia_frac is always nonnegative.

       taia_less returns 1 if a is smaller than b, 0 otherwise.

       taia_add adds a and b modulo 2^64x10^18 and puts  the  result  into  t.
       The inputs and outputs may overlap.

       taia_sub  subtracts b from a modulo 2^64x10^18 and puts the result into
       t.  The inputs and outputs may overlap.

       taia_half divides a by 2, rounding down, and puts the  result  into  t.


                                                                       taia(3)

Man(1) output converted with man2html