slint/tests/cases/expr/exp.slint
Bryce Happel Walton dedc5d31e2
Added Exp and Ln functions to Slint (#8226)
ChangeLog: Added Math.exp and Math.ln
2025-04-25 14:30:38 +02:00

27 lines
651 B
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
TestCase := Rectangle {
property <float> t1: exp(0);
property <float> t2: exp(ln(4.0));
}
/*
```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
assert_eq(instance.get_t1(), 1.0);
assert_eq(instance.get_t2(), 4.0);
```
```rust
let instance = TestCase::new().unwrap();
assert_eq!(instance.get_t1(), 1.0);
assert_eq!(instance.get_t2(), 4.0);
```
```js
var instance = new slint.TestCase({});
assert.equal(instance.t1, 1);
assert.equal(instance.t2, 4);
```
*/