SSM-Clock Stamp – Canonical Formatting (theta precision) (5.8)

Objective. Prove that theta_deg printing is deterministic across tools when using fixed digits and banker’s rounding under IEEE-754 binary64 — all plain ASCII.

Rules (must)

  • Compute from UTC only:
    wrap360(x) = x - 360*floor(x/360)
    theta_deg = wrap360( (unix_seconds / 86400) * 360 )
  • Derive sector:
    rasi_idx = floor(theta_deg / 30)
  • Print theta_deg with exactly theta_prec fractional digits (default 5) using round-half-to-even; decimal point is .; no thousands separators.
  • Compare the printed theta_deg as a string to the recorded field.

Steps (deterministic)

  1. Parse iso_utc = "YYYY-MM-DDThh:mm:ssZ" (UTC, seconds only; reject 23:59:60).
  2. Compute unix_seconds = seconds_since_1970_UTC(iso_utc).
  3. Compute angles:
    theta_deg = wrap360( (unix_seconds / 86400) * 360 )
    rasi_idx = floor(theta_deg / 30)
  4. Format theta_deg with theta_prec digits using banker’s rounding (IEEE-754 binary64).
  5. Check: the formatted string equals the recorded theta_deg. Also require rasi_idx equality.

Expected output (stdout, ASCII)

CLOCK_OK=true

(If a tool cannot reproduce the exact print but matches numerically within <= 0.5 * 10^(-theta_prec), you MAY flag a policy warning and fix the print logic.)

Tiny probes (suggested)

  • Exact half-way case to test half-to-even (choose times where theta_deg’s next digit is exactly 5).
  • Near a sector cusp theta_deg ≈ 30*k to confirm rasi_idx flips only when crossing the boundary.
  • Day wrap: theta(t+1s) ≈ wrap360(theta(t) + 360/86400).

Common pitfalls (avoid)

  • Printing with default locale (, decimal) or different rounding rule.
  • Emitting variable digits (e.g., trimming trailing zeros).
  • Using extended precision during formatting (must be binary64).
  • Including subseconds in iso_utc or any timezone offset.

Why this matters

  • The Shunyaya Symbolic Mathematical Clock Stamp relies on string-equal theta_deg. Fixed-digit, banker’s-rounded prints eliminate cross-platform drift and make anchors reproducible.

Navigation
Back: SSM-Clock Stamp – Anchor Mismatch → Root-Cause (5.7)
Next: SSM-Clock Stamp – UTC Day Boundary (continuity sanity) (5.9)