15 lines
359 B
C#
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);
|
||
|
}
|
||
|
}
|
||
|
}
|