# Fortran Wiki merge_bits

## Description

merge_bits(i, j, mask) merges the bits of i and j as determined by the mask. The $k$-th bit of the result is equal to the $k$-th bit of i if the $k$-th bit of mask is 1; it is equal to the $k$-th bit of j otherwise.

## Standard

Fortran 2008 and later

## Class

Elemental function