Returns the value of x rounded using the specified rounding _mode. If no rounding _mode is specified the default context rounding _mode is used instead.
InvalidOperationException if x is signaling NaN
assert(nearbyint(decimal32("1.2"), RoundingMode.tiesToEven) == 1); assert(nearbyint(decimal64("2.7"), RoundingMode.tiesToAway) == 3); assert(nearbyint(decimal128("-7.9"), RoundingMode.towardZero) == -7); assert(nearbyint(decimal128("6.66")) == 7);
See Implementation
Returns the value of x rounded using the specified rounding _mode. If no rounding _mode is specified the default context rounding _mode is used instead.