new function isRational() that return true is the passed value is integere or fraction

This commit is contained in:
2024-05-10 09:17:51 +02:00
parent 8c66d90532
commit 5a9b6525a2
2 changed files with 13 additions and 1 deletions
+7
View File
@@ -44,6 +44,13 @@ func IsFract(v any) (ok bool) {
return ok
}
func IsRational(v any) (ok bool) {
if _, ok = v.(*fraction); !ok {
_, ok = v.(int64)
}
return ok
}
func IsNumber(v any) (ok bool) {
return IsFloat(v) || IsInteger(v)
}