79413169

Date: 2025-02-04 22:25:46
Score: 0.5
Natty:
Report link

I have implementation of Banker's Round from cpython which match exactly to python3 round() function. Original source

float pythonRound(float x) {
    float rounded = std::round(x);
    if (std::fabs(x - rounded) == 0.5f) {
        return (2.0f * std::round(x / 2.0f));
    }
    return rounded;
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Aleksandr Serov