mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
make decimal math ops correctly report overflow
This commit is contained in:
parent
2b5ec3dcf1
commit
23ea151d5f
8 changed files with 155 additions and 165 deletions
|
@ -1,6 +1,10 @@
|
|||
const std = @import("std");
|
||||
const always_inline = std.builtin.CallOptions.Modifier.always_inline;
|
||||
|
||||
pub fn WithOverflow(comptime T: type) type {
|
||||
return extern struct { value: T, has_overflowed: bool };
|
||||
}
|
||||
|
||||
// If allocation fails, this must cxa_throw - it must not return a null pointer!
|
||||
extern fn roc_alloc(size: usize, alignment: u32) callconv(.C) ?*c_void;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue