Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,3 @@
create type Complex as struct (r float, i float);
create type Rational as struct (n integer, d integer);

View file

@ -0,0 +1,16 @@
create or replace function number_integerp(x) as (
x = trunc(x)
);
# Return true iff x has the type signature of a Rational
# with the denominator dividing the numerator evenly.
create or replace function rational_integerp(x) as (
typeof(x) = 'STRUCT(n INTEGER, d INTEGER)'
and x.n % x.d = 0
);
# Return true if x can be cast to a Complex with
# the imaginary part equal to 0 and an integer real part.
create or replace function complex_integerp(x) as (
(x::Complex).i = 0 and number_integerp(x.r)
);