Karim Belabas on Mon, 15 Jun 2009 18:29:18 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: A12-140 Question about round()


* Kurt Foster [2009-06-15 17:55]:
> It occurred to me to wonder what round() did when the input has fractional 
> part == 1/2.  Some examples indicated that if N is an integer,
>
> round(N + 1/2) == ceil(N + 1/2).
>
> Is this generally the case?

The documentation (??round) states

  "(rounding to + oo in case of ties)"

so your guess is right.

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`