AngouriMath
Round(AngouriMath.Entity)
Method (no overloads)
Summary
The nearest integer to a , a tie going to the even one.
Parameter "a"
The argument to round.
Returns
The rounded argument.
Remarks
Half to even, as Python, SymPy, Mathematica and IEEE 754 all round: round(1/2) is 0 and round(3/2) is 2 . It is therefore notfloor(x + 1/2) , which differs at every tie.
Example
using System;
using static AngouriMath.MathS;
Console.WriteLine(Round("1/2").Simplify());
Console.WriteLine(Round("3/2").Simplify());
Console.WriteLine(Round("5/2").Simplify());Prints
0
2
2Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1953 pages online