taia(3) taia(3) NNAAMMEE taia - manipulate times with 1-attosecond precision SSYYNNTTAAXX ##iinncclluuddee <> double ttaaiiaa__aapppprrooxx(&_t); double ttaaiiaa__ffrraacc(&_t); void ttaaiiaa__ttaaii(&_t,&_s_e_c); int ttaaiiaa__lleessss(&_a,&_b); void ttaaiiaa__aadddd(&_t,&_a,&_b); void ttaaiiaa__ssuubb(&_t,&_a,&_b); void ttaaiiaa__hhaallff(&_t,&_a); unsigned int ttaaiiaa__ffmmttffrraacc(_s,&_t); struct taia _t; struct taia _a; struct taia _b; struct tai _s_e_c; char *_s; DDEESSCCRRIIPPTTIIOONN A ssttrruucctt ttaaiiaa stores an integer between 0 inclusive and 2^64x10^18 exclusive. The format of ssttrruucctt ttaaiiaa is designed to speed up common operations; applications should not look inside ssttrruucctt ttaaiiaa. A ssttrruucctt ttaaiiaa variable is commonly used to store a TAI64NA label. Each TAI64NA label refers to one attosecond of real time; see hhttttpp::////ppoobbooxx..ccoomm//~~ddjjbb//pprroottoo//ttaaii6644..ttxxtt for more information. The inte- ger in the ssttrruucctt ttaaiiaa is 10^18 times the second count, plus 10^9 times the nanosecond count, plus the attosecond count. A ssttrruucctt ttaaiiaa variable may also be used to store the numerical differ- ence between two TAI64NA labels. AARRIITTHHMMEETTIICC ttaaiiaa__aapppprrooxx returns a double-precision approximation to _t/10^18. The result of ttaaiiaa__aapppprrooxx is always nonnegative. ttaaiiaa__ttaaii places into _s_e_c the integer part of _t/10^18. ttaaiiaa__ffrraacc returns a double-precision approximation to the fraction part of _t/10^18. The result of ttaaiiaa__ffrraacc is always nonnegative. ttaaiiaa__lleessss returns 1 if _a is smaller than _b, 0 otherwise. ttaaiiaa__aadddd adds _a and _b modulo 2^64x10^18 and puts the result into _t. The inputs and outputs may overlap. ttaaiiaa__ssuubb subtracts _b from _a modulo 2^64x10^18 and puts the result into _t. The inputs and outputs may overlap. ttaaiiaa__hhaallff divides _a by 2, rounding down, and puts the result into _t. The input and output may overlap. FFOORRMMAATTTTIINNGG ttaaiiaa__ffmmttffrraacc prints the remainder of _t/10^18, padded to exactly 18 dig- its, into the character buffer _s, without a terminating NUL. It returns 18, the number of characters written. _s may be zero; then ttaaiiaa__ffmmttffrraacc returns 18 without printing anything. The macro TTAAIIAA__FFMMTTFFRRAACC is defined as 19; this is enough space for the output of ttaaiiaa__ffmmttffrraacc and a terminating NUL. SSEEEE AALLSSOO taia_now(3), taia_pack(3), tai(3) taia(3)