Carp/core/SafeInt.carp

13 lines
538 B
Plaintext
Raw Normal View History

(system-include "carp_safe_int.h")
(defmodule Int
2020-04-24 11:28:00 +03:00
(not-on-windows ; this seems to generate invalid code on some windows machines
(doc safe-add "Performs an addition and checks whether it overflowed.")
(register safe-add (λ [Int Int (Ref Int)] Bool))
(doc safe-sub "Performs an substraction and checks whether it overflowed.")
(register safe-sub (λ [Int Int (Ref Int)] Bool))
(doc safe-mul "Performs an multiplication and checks whether it overflowed.")
(register safe-mul (λ [Int Int (Ref Int)] Bool))
)
2019-05-01 01:24:29 +03:00
)