Tweaks for tests, allow for grabbing global scope variables

This commit is contained in:
2018-11-14 17:04:04 +01:00
parent 7e1edbe3f1
commit d6057ae954
7 changed files with 52 additions and 25 deletions

View File

@@ -82,5 +82,18 @@ namespace Upsilon.BaseTypes.Number
#endregion
public static explicit operator double(Number n)
{
if (n.IsFloat)
return ((NumberDouble) n);
return ((NumberLong) n).Value;
}
public static explicit operator long(Number n)
{
if (n.IsFloat)
return (long)((NumberDouble) n).Value;
return ((NumberLong) n).Value;
}
}
}