Rust: Fix comparison of big integers

Don't convert integer to f32 in the rust generated code
This commit is contained in:
Olivier Goffart 2025-01-20 13:17:48 +01:00
parent af23873f86
commit de80bb0a2c
3 changed files with 9 additions and 3 deletions

View file

@ -2361,7 +2361,7 @@ fn compile_expression(expr: &Expression, ctx: &EvaluationContext) -> TokenStream
if lhs_ty.as_unit_product().is_some() && (*op == '=' || *op == '!') {
let maybe_negate = if *op == '!' { quote!(!) } else { quote!() };
quote!(#maybe_negate sp::ApproxEq::<f32>::approx_eq(&(#lhs as f32), &(#rhs as f32)))
quote!(#maybe_negate sp::ApproxEq::<f64>::approx_eq(&(#lhs as f64), &(#rhs as f64)))
} else {
let (conv1, conv2) = match crate::expression_tree::operator_class(*op) {
OperatorClass::ArithmeticOp => match lhs_ty {