Modulo panicking
Opened this issue · 0 comments
Omnia89 commented
Describe the bug
I've tried to use the modulo operator, either like an operator and the function, but it keeps giving me error on execution.
I'm using the JSON format of the rule.
The object given is a JSON, and I've tried to give both {"Lengh": 10}
and {"Lengh": 10.0}
The rule is:
--- Function version
[
{
"name": "Test",
"salience": 10,
"then": [
{
"set": [
"Item.Price",
{
"call": [
"ItemFunc.PriceMultiply",
{
"obj": "Item.Price"
},
{
"const": 0.9
}
]
}
]
},
{
"call": [
"Retract",
{
"const": "Test"
}
]
}
],
"when": {
"eq": [
{
"call": [
"Mod",
{
"obj": "Item.Length"
},
{
"const": 10
}
]
},
{
"const": 0
}
]
}
}
]
--- Operation version
...
"eq": [
{
"mod": [
{
"obj": "Item.Length"
},
{
"const": 10
}
]
},
{
"const": 0
}
]
...
In the first one, the error says that I cannot use int64 for float64 args.
In the second one that I cannot use float64 for int64 args.
Expected behavior
To do the modulo operation
Additional context
github.com/hyperjumptech/grule-rule-engine v1.10.5
go 1.16