MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / eval_frexp

Function eval_frexp

extern/boost/boost/multiprecision/cpp_dec_float.hpp:3390–3414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3388
3389template <unsigned Digits10, class ExponentType, class Allocator>
3390inline void eval_frexp(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x, ExponentType* e)
3391{
3392 result = x;
3393
3394 if (result.iszero() || (result.isinf)() || (result.isnan)())
3395 {
3396 *e = 0;
3397 return;
3398 }
3399
3400 if (result.isneg())
3401 result.negate();
3402
3403 typename cpp_dec_float<Digits10, ExponentType, Allocator>::exponent_type t = result.order();
3404 BOOST_MP_USING_ABS
3405 if (abs(t) < ((std::numeric_limits<typename cpp_dec_float<Digits10, ExponentType, Allocator>::exponent_type>::max)() / 1000))
3406 {
3407 t *= 1000;
3408 t /= 301;
3409 }
3410 else
3411 {
3412 t /= 301;
3413 t *= 1000;
3414 }
3415
3416 result *= cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(-t);
3417

Callers 5

rd_stringMethod · 0.85
generic_interconvertFunction · 0.85
type frexpMethod · 0.85
eval_logFunction · 0.85

Calls 5

absFunction · 0.85
iszeroMethod · 0.80
isnegMethod · 0.80
negateMethod · 0.45
orderMethod · 0.45

Tested by

no test coverage detected