Copy-paste fix pattern
library CB-Math
fn main() {
u8 byteValue = CB-Math.clamp(source_value, 0, 255)
save byteValue
}
ClosedBit Docs
ClosedBit error docs
Unsafe truncation. A conversion would lose information, usually from a larger numeric lane into a smaller lane.
A conversion would lose information, usually from a larger numeric lane into a smaller lane.
Use an explicit clamp or choose a type wide enough to hold the value.
library CB-Math
fn main() {
u8 byteValue = CB-Math.clamp(source_value, 0, 255)
save byteValue
}