Add tests to math and add info in readme how to contribute.

This commit is contained in:
Christoffer Lerno
2023-02-05 14:29:36 +01:00
parent 5a65a57e42
commit 4a102698b2
4 changed files with 154 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
module std::core::values;
macro TypeKind @typekind(#value) @builtin => $typeof(#value).kindof;
macro bool @typeis(#value, $Type) @builtin => $typeof(#value).typeid == $Type.typeid;
macro bool @is_int(#value) => types::is_int($typeof(#value));
macro bool @convertable_to(#a, #b) => $checks($typeof(#b) x = #a);
macro bool @is_floatlike(#value) => types::is_floatlike($typeof(#value));
@@ -8,7 +10,7 @@ macro bool @is_promotable_to_floatlike(#value) => types::is_promotable_to_floatl
macro bool @is_same_vector_type(#value1, #value2) => types::is_same_vector_type($typeof(#value1), $typeof(#value2));
macro promote_int(x)
{
$if (values::@is_int(x)):
$if (@is_int(x)):
return (double)x;
$else:
return x;