Skip to content

Conversation

@dunds-com
Copy link
Contributor

When having an unsigned integer in the model, it didn't allow calculations.

var template = Template.Parse("{{ test1 * test2 }}");
var result = template.Render(new
{
	test1 = (uint)55,
	test2 = (uint)80
});

Console.WriteLine(result);
Console.ReadKey(true);

Unsupported types 55/uint * 80/uint for binary operation

This PR adds support for uints.

@xoofx
Copy link
Member

xoofx commented Aug 18, 2025

Could you add a unit test?

@dunds-com
Copy link
Contributor Author

Should I add a scriban file as a unit test?

@xoofx
Copy link
Member

xoofx commented Aug 29, 2025

Should I add a scriban file as a unit test?

Oh, no, you can add just a test in e.g. TestRuntime.cs similar to what is already done for some other specific cases.

Wondering also if the result should not be ulong in the end. BigInteger is quickly quite less practical.

@xoofx xoofx merged commit 0f7f8bf into scriban:master Sep 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants