Re: Why Round[5/2]=2?
- To: mathgroup at smc.vnet.net
- Subject: [mg17499] Re: Why Round[5/2]=2?
- From: Leszek Sczaniecki <lsczan at concentric.net>
- Date: Mon, 10 May 1999 01:44:32 -0400
- Organization: Concentric Internet Services
- References: <7h4j9n$ei9@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Actually this is a feature. Round rounds numbers of the form x.5 toward the nearest even integer. I know how annoying this is to people from fields that do not implement this arbitrary (in my judgment) IEEE standard, but your only choice is to write your own Round. Personally, I believe that it would be quite useful to have an option for different rounding methods, but that issue should be addressed to Mathematica developers. --Leszek Xing Jing Li wrote: > 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? > > Thanks, > > Xing Jing Li