MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / rint

Function rint

include/my_global.h:1150–1167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1148*/
1149
1150static inline double rint(double x)
1151{
1152 double f, i;
1153 f = modf(x, &i);
1154 /*
1155 All doubles with absolute values > MAX_EXACT_INTEGER are even anyway,
1156 no need to check it.
1157 */
1158 if (x > 0.0)
1159 i += (double) ((f > 0.5) || (f == 0.5 &&
1160 i <= (double) MAX_EXACT_INTEGER &&
1161 (longlong) i % 2));
1162 else
1163 i -= (double) ((f < -0.5) || (f == -0.5 &&
1164 i >= (double) -MAX_EXACT_INTEGER &&
1165 (longlong) i % 2));
1166 return i;
1167}
1168#endif /* HAVE_RINT */
1169
1170/*

Callers 8

double2lldiv_tFunction · 0.85
val_intMethod · 0.85
my_double_roundFunction · 0.85
val_intMethod · 0.85
val_intMethod · 0.85
val_intMethod · 0.85
update_timestampFunction · 0.85
val_intMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected