Cita:
|
Empezado por Al González
Como en Delphi Win32 no existe una previsión seria al respecto
|
No entiendo a qué te refieres. La función RoundTo, por defecto, usa el redondeo del banquero:
Cita:
|
Empezado por ayuda de Delphi
RoundTo uses “Banker’s Rounding” to determine how to round values that are exactly midway between the two values that have the desired number of significant digits. This method rounds to an even number in the case that AValue is not nearer to either value.
|
Pero, como la misma ayuda dice, el método de redondeo se puede cambiar:
Cita:
|
Empezado por ayuda de Delphi
Note: The behavior of RoundTo can be affected by the Set8087CW procedure or SetRoundMode function.
|
Y estas son las posibilidades:
Cita:
|
Empezado por ayuda de Delphi
rmNearest -Rounds to the closest value. (banquero)
rmDown - Rounds toward negative infinity. (infinito negativo)
rmUp - Rounds toward positive infinity. (infinto positvo)
rmTruncate - Truncates the value, rounding positive numbers down and negative numbers up. (a cero)
|
Sólo faltaría el que, como mencionas, no es parte del estándar, pero que fácilmente se puede implementar con:
Sign(n)*Round(Abs(n));
usdando el método de infinito positivo.
// Saludos