ΒΆtemplate <class DigitsT>
int16_t matchScales(DigitsT& LDigits,
                    int16_t& LScale,
                    DigitsT& RDigits,
                    int16_t& RScale)

Description

Match scales of two numbers. Given two scaled numbers, match up their scales. Change the digits and scales in place. Shift the digits as necessary to form equivalent numbers, losing precision only when necessary. If the output value of \c LDigits (\c RDigits) is \c 0, the output value of\c LScale (\c RScale) is unspecified. As a convenience, returns the matching scale. If the output value of one number is zero, returns the scale of the other. If both are zero, which scale is returned is unspecified.

Declared at: llvm/include/llvm/Support/ScaledNumber.h:286

Templates

DigitsT

Parameters

DigitsT& LDigits
int16_t& LScale
DigitsT& RDigits
int16_t& RScale