Esempio n. 1
0
int ObNumber::negate(ObNumber &res) const
{
    int ret = OB_SUCCESS;
    if (this->nwords_ >= MAX_NWORDS)
    {
        jlog(WARNING, "value out of range to do negate");
        ret = JD_VALUE_OUT_OF_RANGE;
    }
    else
    {
        res = *this;
        res.extend_words(static_cast<int8_t> (this->nwords_ + 1));
        negate(res, res);
        res.remove_leading_zeroes();
    }
    return ret;
}