KumiScript/interpreter/expression/NumberFactory.cs
2024-01-25 23:37:51 -06:00

15 lines
359 B
C#

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);
}
}
}