Allow dur/dur division (#3812)

It is perfectly valid to divide two durations, it is a ratio with no
unit.
This commit is contained in:
Ram-Z 2025-03-12 20:48:49 +00:00 committed by GitHub
parent 5c67d22540
commit f73b42d23f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 9 deletions

View file

@ -302,13 +302,10 @@ int TEST_NAME(int, char**) {
}
// duration / duration -> duration
try {
Variant v55 = v5 / v5;
t.fail("1200 / 1200 --> error");
} catch (...) {
t.pass("1200 / 1200 --> error");
}
Variant v55 = v5 / v5;
t.is(v55.type(), Variant::type_real, "1200 / 1200 --> real");
t.is(v55.get_real(), 1.0, "1200 / 1200 --> 1.0");
t.is((v5 / v52).get_real(), 3.14136, EPSILON, "1200 / 382 --> 3.14136");
return 0;
}