fix(numerics): add missing numeric_traits<float>::zero()

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-10-28 07:46:49 -07:00
parent b16a64f44b
commit 1d18f60dd5
2 changed files with 2 additions and 1 deletions

View file

@ -33,6 +33,7 @@ static void tst1() {
tst_num(mpfp(0.0, 512)); tst_num(mpfp(0.0, 512));
tst_num(mpbq(3)); tst_num(mpbq(3));
tst_num(1.0); tst_num(1.0);
tst_num(static_cast<float>(1.0));
} }
int main() { int main() {

View file

@ -25,7 +25,7 @@ void float_ceil(float & v) { v = std::ceil(v); }
void float_floor(float & v) { v = std::floor(v); } void float_floor(float & v) { v = std::floor(v); }
static float g_zero = 0.0; static float g_zero = 0.0;
float const & zero() { float const & numeric_traits<float>::zero() {
return g_zero; return g_zero;
} }
}; };