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