1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4479 Imported couple functions from boost::math to remove libquadmath dependency

This commit is contained in:
Roman Nozdrin
2020-12-30 10:34:50 +00:00
parent cf11e03d4b
commit aa5211f192
6 changed files with 482 additions and 30 deletions

View File

@ -1,5 +1,5 @@
/* Copyright (C) 2014 InfiniDB, Inc.
Copyright (C) 2019 MariaDB Corporation
Copyright (C) 2019-20 MariaDB Corporation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -22,8 +22,6 @@
#include <string>
using namespace std;
#include <quadmath.h>
#include "functor_dtm.h"
#include "functor_int.h"
#include "functor_real.h"
@ -1540,14 +1538,14 @@ IDB_Decimal Func_cast_decimal::getDecimalVal(Row& row,
{
if (decimal.isTSInt128ByPrecision())
{
// it is worth to parse the exponent first to detect an overflow
bool dummy = false;
char *ep = NULL;
int128_t max_number_decimal = dataconvert::strtoll128(columnstore_big_precision[max_length - 19].c_str(), dummy, &ep);
int128_t scaleDivisor;
datatypes::getScaleDivisor(scaleDivisor, decimals);
__float128 floatValue = strtoflt128 (str, 0);
__float128 floatValue = datatypes::TFloat128::fromString(strValue);
// If the float value is too large, the saturated result may end up with
// the wrong sign, so we just check first.

View File

@ -25,8 +25,6 @@
#include <string>
using namespace std;
#include <quadmath.h>
#include "functor_real.h"
#include "funchelpers.h"
#include "functioncolumn.h"
@ -100,7 +98,7 @@ IDB_Decimal Func_mod::getDecimalVal(Row& row,
datatypes::getScaleDivisor(scaleDivisor, d.scale);
dividendF = (__float128) dividendInt / scaleDivisor;
__float128 mod = fmodq(dividendF, divF) * scaleDivisor;
__float128 mod = datatypes::TFloat128::fmodq(dividendF, divF) * scaleDivisor;
return IDB_Decimal(datatypes::TSInt128((int128_t) mod),
d.scale,