mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 04:44:12 +03:00
11 lines
441 B
Plaintext
11 lines
441 B
Plaintext
(system-include "carp_safe_int.h")
|
|
|
|
(defmodule Int
|
|
(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))
|
|
)
|