diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-12-08 14:28:26 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-12-08 14:28:26 -0500 |
| commit | d65a0abba13a041fa07851b4db222336fab1d954 (patch) | |
| tree | 9428ce401d10181cc45e4176c9e6077d8bf43dca /environment.c | |
| parent | 841c8114a3defdef74042e0f92930debe9ff93fc (diff) | |
Add GCD function for integers (of all flavors)
Diffstat (limited to 'environment.c')
| -rw-r--r-- | environment.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/environment.c b/environment.c index 6182143c..cc7a92f6 100644 --- a/environment.c +++ b/environment.c @@ -122,6 +122,7 @@ env_t *new_compilation_unit(CORD libname) {"clamped", "Int$clamped", "func(x,low,high:Int -> Int)"}, {"divided_by", "Int$divided_by", "func(x,y:Int -> Int)"}, {"format", "Int$format", "func(i:Int, digits=0 -> Text)"}, + {"gcd", "Int$gcd", "func(x,y:Int -> Int)"}, {"parse", "Int$parse", "func(text:Text -> Int?)"}, {"hex", "Int$hex", "func(i:Int, digits=0, uppercase=yes, prefix=yes -> Text)"}, {"is_prime", "Int$is_prime", "func(x:Int,reps=50 -> Bool)"}, @@ -147,6 +148,7 @@ env_t *new_compilation_unit(CORD libname) {"clamped", "Int64$clamped", "func(x,low,high:Int64 -> Int64)"}, {"divided_by", "Int64$divided_by", "func(x,y:Int64 -> Int64)"}, {"format", "Int64$format", "func(i:Int64, digits=0 -> Text)"}, + {"gcd", "Int64$gcd", "func(x,y:Int64 -> Int64)"}, {"parse", "Int64$parse", "func(text:Text -> Int64?)"}, {"hex", "Int64$hex", "func(i:Int64, digits=0, uppercase=yes, prefix=yes -> Text)"}, {"max", "Int64$max", "Int64"}, @@ -166,6 +168,7 @@ env_t *new_compilation_unit(CORD libname) {"clamped", "Int32$clamped", "func(x,low,high:Int32 -> Int32)"}, {"divided_by", "Int32$divided_by", "func(x,y:Int32 -> Int32)"}, {"format", "Int32$format", "func(i:Int32, digits=0 -> Text)"}, + {"gcd", "Int32$gcd", "func(x,y:Int32 -> Int32)"}, {"parse", "Int32$parse", "func(text:Text -> Int32?)"}, {"hex", "Int32$hex", "func(i:Int32, digits=0, uppercase=yes, prefix=yes -> Text)"}, {"max", "Int32$max", "Int32"}, @@ -185,6 +188,7 @@ env_t *new_compilation_unit(CORD libname) {"clamped", "Int16$clamped", "func(x,low,high:Int16 -> Int16)"}, {"divided_by", "Int16$divided_by", "func(x,y:Int16 -> Int16)"}, {"format", "Int16$format", "func(i:Int16, digits=0 -> Text)"}, + {"gcd", "Int16$gcd", "func(x,y:Int16 -> Int16)"}, {"parse", "Int16$parse", "func(text:Text -> Int16?)"}, {"hex", "Int16$hex", "func(i:Int16, digits=0, uppercase=yes, prefix=yes -> Text)"}, {"max", "Int16$max", "Int16"}, @@ -204,6 +208,7 @@ env_t *new_compilation_unit(CORD libname) {"clamped", "Int8$clamped", "func(x,low,high:Int8 -> Int8)"}, {"divided_by", "Int8$divided_by", "func(x,y:Int8 -> Int8)"}, {"format", "Int8$format", "func(i:Int8, digits=0 -> Text)"}, + {"gcd", "Int8$gcd", "func(x,y:Int8 -> Int8)"}, {"parse", "Int8$parse", "func(text:Text -> Int8?)"}, {"hex", "Int8$hex", "func(i:Int8, digits=0, uppercase=yes, prefix=yes -> Text)"}, {"max", "Int8$max", "Int8"}, |
