mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Make mod()
a macro that can take generic types instead of just integer
This commit is contained in:
parent
d48c590346
commit
92b4f52556
9 changed files with 78 additions and 15 deletions
|
@ -2363,11 +2363,7 @@ fn compile_builtin_function_call(
|
|||
BuiltinFunction::Debug => {
|
||||
format!("std::cout << {} << std::endl;", a.join("<<"))
|
||||
}
|
||||
BuiltinFunction::Mod => format!(
|
||||
"static_cast<int>({}) % static_cast<int>({})",
|
||||
a.next().unwrap(),
|
||||
a.next().unwrap()
|
||||
),
|
||||
BuiltinFunction::Mod => format!("std::fmod({}, {})", a.next().unwrap(), a.next().unwrap()),
|
||||
BuiltinFunction::Round => format!("std::round({})", a.next().unwrap()),
|
||||
BuiltinFunction::Ceil => format!("std::ceil({})", a.next().unwrap()),
|
||||
BuiltinFunction::Floor => format!("std::floor({})", a.next().unwrap()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue