MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Why Round[5/2]=2?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17525] Re: Why Round[5/2]=2?
  • From: phbrf at t-online.de (Peter Breitfeld)
  • Date: Fri, 14 May 1999 01:13:03 -0400
  • Organization: das ist ein breites Feld ...
  • References: <7h4j9n$ei9@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Xing Jing Li <xingjing at calvin.math.vt.edu> schrieb:
> While  I am working on the exercises on the book _Power Programming
> with Mathematica_ I noticed that Round[5/2] gave me 2. It is obviously
> wrong. But how could this happen? I am using Mathematica 3.0.1 on a
> Macintosh. I also tried the command"Round[5/2]" on other Macintoshes
> and PCs and all them gave me 2. Is this some kind bug? Other numbers I
> tried gave me the answers I expected. 
> 
> Can some one tell me what is going on?
> 
 
Xing,
In Mathematica numbers of the form x.5 are rounded to the nearest _even_
integer. (at least since MMa 3.0)

 

Es gruesst  Peter
-- 
=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=
  Peter Breitfeld, Saulgau, Germany        PGP public key:  08548045


  • Prev by Date: Problem with keyboard mapping
  • Next by Date: Re: positive numbers
  • Previous by thread: Re: Why Round[5/2]=2?
  • Next by thread: Cellular Automata question