taia(3)
π¦ NAME π¦
Okay bestie, welcome to taia(3) β the Temps Atomique International (Attosecond) time routines. Yes, thatβs the whole vibe: attosecond time math, and itβs lowkey iconic. β¨
β¨ SYNTAX β¨
#include "taia.h"
extern int taia_add(struct taia *t,const struct taia *a,const struct
taia *b);
extern int taia_addsec(struct taia *t,const struct taia *s,int secs);
extern int taia_approx(const struct taia *t);
int taia_frac(const struct taia *t);
extern int taia_less(const struct tai *a,const struct tai *b);
extern int taia_now(struct taia *t);
extern int taia_pack(char *buf,const struct taia *t);
extern int taia_sub(struct taia *t,const struct taia *a,const struct
taia *b);
extern int taia_tai(const struct taia *t,struct tai *sec);
extern int taia_uint(struct taia *t,unsigned int secs);
extern int taia_unpack(const char *buf,struct taia *t);
π DESCRIPTION π
taia_addβ addsatoband writes the result tot. The inputs and output may overlap. Overlap? Fine. No drama. π«Άtaia_addsecβ addssecsseconds tosand writes the result tot. The inputs and output may overlap. Same slay, different function. πtaia_approxβ returns a double-precision approximation oft. The result oftaia_approxis always nonnegative. No negative-energy nonsense here. β¨taia_fracβ returns a double-precision approximation to the fraction part oft. The result oftaia_fracis always nonnegative. Fractional, but make it positive. πtaia_lessβ returns1ifais less thanb, and0otherwise. Literally just a vibe check in numeric form. πtaia_nowβ puts the current time intot. More precisely:tai_nowputs intotits best guess as to theTAI64NAlabel for the1-attosecondinterval that contains the current time. Yes, the page saystai_nowthere β Iβm keeping it exactly as written, bestie. π
This implementation of taia_now assumes that the time_t returned from the time function represents the number of TAI seconds since 1970-01-01 00:00:10 TAI. This matches the convention used by the Olson tz library in right mode. β°
Beware that many clocks are not set accurately, and even the best scientific clocks are nowhere near 1-attosecond accuracy; however, an inaccurate clock may still produce reasonably accurate time differences. Clock accuracy is giving "bestie, I tried," not "certified atomic diva." π
taia_packβ converts aTAI64NAlabel from internal format intto externalTAI64NAformat inbuf. Pack it up, pack it in. πtaia_subβ subtractsbfromaand writes the result tot. The inputs and output may overlap. Subtraction with overlap permission: iconic. π₯taia_taiβ places intosecthe integer part oft. Iftcontains aTAI64NAlabel thensecwill contain the correspondingTAI64label. Whole seconds only, no fractional crumbs. πtaia_uintβ convertssecsinto astruct taia(setting the fractional part to zero). Clean, simple, zero fractional chaos. πΈtaia_unpackβ converts aTAI64NAlabel from externalTAI64NAformat inbufto internal format int. Unpack the time, bestie. π¦
π SEE ALSO π
Go vibe with time(1), utime(3), ctime(3), and locale(1) β thatβs the whole squad. π
Signed with sparkles: this is taia(3) from the Library Functions Manual β the footer doesnβt give a separate date or version stamp, so Iβm not inventing one, periodt. π
π¦ where this page comes from
- alpine 3.24: fehqlibs-doc 31-r0 Β· Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms