2018-03-06 18:44:07 +03:00
|
|
|
(system-include "carp_safe_int.h")
|
|
|
|
|
|
|
|
(defmodule Int
|
2018-05-12 16:58:49 +03:00
|
|
|
(doc safe-add "Performs an addition and checks whether it overflowed.")
|
2018-03-06 18:44:07 +03:00
|
|
|
(register safe-add (λ [Int Int (Ref Int)] Bool))
|
2018-05-12 16:58:49 +03:00
|
|
|
(doc safe-sub "Performs an substraction and checks whether it overflowed.")
|
2018-03-06 18:44:07 +03:00
|
|
|
(register safe-sub (λ [Int Int (Ref Int)] Bool))
|
2018-05-12 16:58:49 +03:00
|
|
|
(doc safe-mul "Performs an multiplication and checks whether it overflowed.")
|
2018-03-06 18:44:07 +03:00
|
|
|
(register safe-mul (λ [Int Int (Ref Int)] Bool))
|
|
|
|
)
|