From fcedfddf00b3f994e4f4e40332ac7fc192c63244 Mon Sep 17 00:00:00 2001 From: polwex Date: Sun, 5 Oct 2025 21:56:51 +0700 Subject: claude is gud --- vere/pkg/noun/jets/c/ctz.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 vere/pkg/noun/jets/c/ctz.c (limited to 'vere/pkg/noun/jets/c/ctz.c') diff --git a/vere/pkg/noun/jets/c/ctz.c b/vere/pkg/noun/jets/c/ctz.c new file mode 100644 index 0000000..ff74e24 --- /dev/null +++ b/vere/pkg/noun/jets/c/ctz.c @@ -0,0 +1,34 @@ +/// @file + +#include "jets/q.h" +#include "jets/w.h" + +#include "noun.h" + +u3_atom +u3qc_ctz(u3_atom a) +{ + c3_w wor_w, i_w = 0; + + if ( 0 == a ) { + return 0; + } + + do { + wor_w = u3r_word(i_w++, a); + } + while ( !wor_w ); + + { + c3_w bit_d = i_w - 1; + bit_d *= 32; + bit_d += c3_tz_w(wor_w); + return u3i_chub(bit_d); + } +} + +u3_noun +u3wc_ctz(u3_noun cor) +{ + return u3qc_ctz(u3x_atom(u3h(u3t(cor)))); +} -- cgit v1.2.3