MCPcopy Create free account
hub / github.com/apache/arrow / bround_float64

Function bround_float64

cpp/src/gandiva/precompiled/extended_math_ops.cc:294–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292// rounds the number to the nearest integer
293FORCE_INLINE
294gdv_float64 bround_float64(gdv_float64 num) {
295 gdv_float64 round_num = round(num);
296 gdv_float64 diff_num = round_num - num;
297 if ((diff_num != 0.5) && (diff_num != -0.5)) {
298 return round_num;
299 }
300 if (fmod(round_num, 2.0) == 0.0) {
301 return round_num;
302 }
303
304 return num - diff_num;
305}
306
307// rounds the number to the given scale
308#define ROUND_DECIMAL_TO_SCALE(TYPE) \

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68