mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add tests to math and add info in readme how to contribute.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user