[#llvm-SaturatingMultiply] = xref:llvm.adoc[llvm]::SaturatingMultiply :relfileprefix: ../ :mrdocs: Multiply two unsigned integers with saturation on overflow. == Synopsis Declared in `<llvm/Support/MathExtras.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> T SaturatingMultiply( T X, T Y, bool* ResultOverflowed = nullptr) requires std::is_unsigned_v<T>; ---- == Description Clamp the result to the maximum representable value of T on overflow. ResultOverflowed indicates if the result is larger than the maximum representable value of type T. == Return Value The saturated product of X and Y. == Parameters [cols="1,4"] |=== | Name| Description | *X* | First factor. | *Y* | Second factor. | *ResultOverflowed* | Optional out‐parameter set when saturation occurs. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#