Numeric

Numeric#

2026-10-23

1 min read time

Applies to Linux and Windows

This page covers the numeric extended API, providing narrowing casts and arithmetic operations with overflow checking and saturation.

Header

Content

Since

cuda::narrow

Casts a value and checks whether the value has changed

libhipcxx 3.4

cuda::overflow_result

Represents the result of arithmetic operations that may overflow

libhipcxx 3.0

cuda::overflow_cast

Casts a value with overflow checking

libhipcxx 3.0

cuda::add_overflow

Performs addition with overflow checking

libhipcxx 3.4

cuda::sub_overflow

Performs subtraction with overflow checking

libhipcxx 3.4

cuda::div_overflow

Performs division with overflow checking

libhipcxx 3.4

cuda::mul_overflow

Performs multiplication with overflow checking

libhipcxx 3.4

cuda::saturating_overflow_cast

Performs saturating cast of a value with overflow checking

libhipcxx 3.4

cuda::saturating_add_overflow

Performs saturating addition with overflow checking

libhipcxx 3.4

cuda::saturating_sub_overflow

Performs saturating subtraction with overflow checking

libhipcxx 3.4

cuda::saturating_div_overflow

Performs saturating division with overflow checking

libhipcxx 3.4

cuda::saturating_mul_overflow

Performs saturating multiplication with overflow checking

libhipcxx 3.4