# FreeBSD Manual Pages

taia(3) Library Functions Manual taia(3)NAMEtaia - manipulate times with 1-attosecond precisionSYNTAX#include<taia.h> doubletaia_approx(&t); doubletaia_frac(&t); voidtaia_tai(&t,&sec); inttaia_less(&a,&b); voidtaia_add(&t,&a,&b); voidtaia_sub(&t,&a,&b); voidtaia_half(&t,&a); unsigned inttaia_fmtfrac(s,&t); struct taiat; struct taiaa; struct taiab; struct taisec; char *s;DESCRIPTIONAstructtaiastores an integer between 0 inclusive and 2^64x10^18 ex- clusive. The format ofstructtaiais designed to speed up common op- erations; applications should not look insidestructtaia. Astructtaiavariable is commonly used to store a TAI64NA label. Each TAI64NA label refers to one attosecond of real time; seehttp://pobox.com/~djb/proto/tai64.txtfor more information. The inte- ger in thestructtaiais 10^18 times the second count, plus 10^9 times the nanosecond count, plus the attosecond count. Astructtaiavariable may also be used to store the numerical differ- ence between two TAI64NA labels.ARITHMETICtaia_approxreturns a double-precision approximation tot/10^18. The result oftaia_approxis always nonnegative.taia_taiplaces intosecthe integer part oft/10^18.taia_fracreturns a double-precision approximation to the fraction part oft/10^18. The result oftaia_fracis always nonnegative.taia_lessreturns 1 ifais smaller thanb, 0 otherwise.taia_addaddsaandbmodulo 2^64x10^18 and puts the result intot. The inputs and outputs may overlap.taia_subsubtractsbfromamodulo 2^64x10^18 and puts the result intot. The inputs and outputs may overlap.taia_halfdividesaby 2, rounding down, and puts the result intot. The input and output may overlap.FORMATTINGtaia_fmtfracprints the remainder oft/10^18, padded to exactly 18 dig- its, into the character buffers, without a terminating NUL. It re- turns 18, the number of characters written.smay be zero; thentaia_fmtfracreturns 18 without printing anything. The macroTAIA_FMTFRACis defined as 19; this is enough space for the output oftaia_fmtfracand a terminating NUL.SEE ALSOtaia_now(3), taia_pack(3), tai(3) taia(3)

NAME | SYNTAX | DESCRIPTION | ARITHMETIC | FORMATTING | SEE ALSO

Want to link to this manual page? Use this URL:

<https://www.freebsd.org/cgi/man.cgi?query=taia&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>