Lemonergy · Studio block
Numeric type conversion
Converts real, Boolean or 32-bit integer elements. Integer conversion truncates toward zero and saturates at the target bounds.
- Implementation ID
native-type-conversion- Reviewed
- 2026-10-27
Behavior
integer output = clamp(trunc(input), target minimum, target maximum). Boolean output = (input ≠ 0).
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
in0 | input | 1 | Input; real 3 array. |
out0 | output | 1 | Integer output; i32 3 array. |
Parameters
No configurable parameters for this component.
Equations and rules
integer output = clamp(trunc(input), target minimum, target maximum)Boolean output = (input ≠ 0)
Worked example
Numeric type conversion — worked example
Input = [2.9,-4.9,6]. Integer output at 0 s = [2,-4,6].
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Integer outputout0 | 0 | [2, -4, 6] | 1 | 1e-09 |
Explore the recorded outputs
Numeric type conversion recorded example
Numeric type conversion [1]2 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.
Read the selected signal as a table
| Time (s) | Value |
|---|
Download the recorded samples (JSON) · Open this Studio example after release
Use in a workflow
Numeric type conversion — worked example
Converts real, Boolean or 32-bit integer elements. Integer conversion truncates toward zero and saturates at the target bounds.
- Numeric type conversion: integer output = clamp(trunc(input), target minimum, target maximum). Boolean output = (input ≠ 0).
- Use the block reference for settings and connections.
- Implementation tested locally; public release pending.
Connected concepts
Limits and interpretation
- Real, Boolean, signed32 and unsigned32 types only; complex and fixed-point scaling conversions are not supported.
Reference basis
This software operation is defined by its public contract and worked example; no external research result is claimed.
Implementation sources
This reference follows the public interface and locally verified numerical checks for an upcoming release.
Contract: Lemonergy Studio public contract · Verification record: verification-2026-10-27
docs/glossary/native-block-verification.json
This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)