3 ms·
Huawei fixed it in their Cangjie language. According to the docs [1][2], it throws an exception by default and you can use an annotation to get wrapping or satu
by ptx 5mo ago
Huawei fixed it in their Cangjie language. According to the docs [1][2], it throws an exception by default and you can use an annotation to get wrapping or saturation instead.
(Cangjie seems like a pretty nice language in other ways as well. Similar to Kotlin with some improvements and no Java. Bootstrapping the toolchain from source seems difficult though.)
[1] https://docs.cangjie-lang.cn/en/docs/0.53.13/white_paper/source_en/cj-wp-dynamiccheck.html#overflow-check https://docs.cangjie-lang.cn/en/docs/0.53.13/white_paper/sou...
[2] https://docs.cangjie-lang.cn/en/docs/0.53.13/spec/source_en/Chapter_04_Expressions.html#arithmetic-expressions https://docs.cangjie-lang.cn/en/docs/0.53.13/spec/source_en/...