Math

Math#

2026-10-23

1 min read time

Applies to Linux and Windows

This page covers the math extended API, providing integer arithmetic utilities including ceiling division, rounding, and integer logarithm functions.

Header

Content

Since

ceil_div

Ceiling division

libhipcxx 2.7

round_up

Round up to the next multiple

libhipcxx 3.0

round_down

Round down to the previous multiple

libhipcxx 3.0

ilog2

Integer logarithm to the base 2

libhipcxx 3.0

ilog10

Integer logarithm to the base 10

libhipcxx 3.0

ipow

Integer power

libhipcxx 3.4

is_power_of_two

If the value is a power of two

libhipcxx 3.4

isqrt

Integer square root

libhipcxx 3.4

neg

Integer negation

libhipcxx 3.4

next_power_of_two

Next power of two

libhipcxx 3.4

prev_power_of_two

Previous power of two

libhipcxx 3.4

uabs

Unsigned absolute value

libhipcxx 3.4

fast_mod_div

Fast Modulo/Division

libhipcxx 3.4

mul_hi

Most significant half of the product

libhipcxx 3.4

sincos

Computes sine and cosine of a value at the same time.

libhipcxx 3.4