Multiply A and B, and add C to the resulting product.

Synopsis

Declared in <llvm/Support/CheckedArithmetic.h>

template<typename T>
std::optional<T>
checkedMulAdd(
    T A,
    T B,
    T C)
requires std::is_signed_v<T>;

Return Value

Optional of result if no signed overflow occurred, std::nullopt otherwise.

Parameters

Name

Description

A

Left‐hand factor of the product.

B

Right‐hand factor of the product.

C

Value added to the product.

Created with MrDocs