taia(3)

πŸ“¦ version 31, in alpine 3.24

πŸ¦‹ 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 β€” adds a to b and writes the result to t. The inputs and output may overlap. Overlap? Fine. No drama. 🫢
  • taia_addsec β€” adds secs seconds to s and writes the result to t. The inputs and output may overlap. Same slay, different function. πŸ’–
  • taia_approx β€” returns a double-precision approximation of t. The result of taia_approx is always nonnegative. No negative-energy nonsense here. ✨
  • taia_frac β€” returns a double-precision approximation to the fraction part of t. The result of taia_frac is always nonnegative. Fractional, but make it positive. πŸŽ€
  • taia_less β€” returns 1 if a is less than b, and 0 otherwise. Literally just a vibe check in numeric form. πŸ’…
  • taia_now β€” puts the current time into t. More precisely: tai_now puts into t its best guess as to the TAI64NA label for the 1-attosecond interval that contains the current time. Yes, the page says tai_now there β€” 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 a TAI64NA label from internal format in t to external TAI64NA format in buf. Pack it up, pack it in. πŸŽ€
  • taia_sub β€” subtracts b from a and writes the result to t. The inputs and output may overlap. Subtraction with overlap permission: iconic. πŸ”₯
  • taia_tai β€” places into sec the integer part of t. If t contains a TAI64NA label then sec will contain the corresponding TAI64 label. Whole seconds only, no fractional crumbs. πŸ“
  • taia_uint β€” converts secs into a struct taia (setting the fractional part to zero). Clean, simple, zero fractional chaos. 🌸
  • taia_unpack β€” converts a TAI64NA label from external TAI64NA format in buf to internal format in t. 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