KumiScript/interpreter/expression/NumberFactory.cs

15 lines
359 B
C#
Raw Normal View History

2024-01-26 05:37:51 +00:00
namespace KumiScript.Interpreter
{
public class NumberFactory
{
public static NumberExpression NormalizeFloat(decimal f)
{
//TODO: Handle overflows
int i = (int) f;
if (i == f)
return new IntegerExpression(i);
return new FloatExpression(f);
}
}
}