Adopt .NET naming and structure: CsMic.* namespaces, PascalCase projects and solution; update Coco namespace; update package id and NuGet publish target; adjust project refs and tests.

This commit is contained in:
Jordan Wages 2025-08-20 20:10:34 -05:00
commit 0a67e6e2cc
24 changed files with 54 additions and 49 deletions

View file

@ -1,38 +0,0 @@
using csmic;
using FunctionValueType = csmic.FunctionValueType;
namespace stdlib.functions
{
public class Sign : FunctionBase, ICodedFunction
{
public const decimal POSITIVE = 1;
public const decimal NEGATIVE = -1;
public string Name
{
get
{
return "sign";
}
}
public override IEnumerable<FunctionArgument> ExpectedArguments
{
get
{
yield return new FunctionArgument("value", FunctionValue.NUMBER);
}
}
public FunctionValue Execute(params FunctionArgument[] args)
{
return base.Execute(args, (_args) =>
{
var input = _args[0].Value;
decimal number = Convert.ToDecimal(input.Value);
return new FunctionValue(FunctionValueType.Numeric, number >= 0 ? POSITIVE : NEGATIVE);
});
}
}
}