mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Rust: Fix comparison of big integers
Don't convert integer to f32 in the rust generated code
This commit is contained in:
parent
af23873f86
commit
de80bb0a2c
3 changed files with 9 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue