       Re: Round[1.5] != Round[3/2] = 2 ???

• To: mathgroup at smc.vnet.net
• Subject: [mg3501] Re: Round[1.5] != Round[3/2] = 2 ???
• From: rhall2 at umbc.edu (hall robert)
• Date: Mon, 18 Mar 1996 00:58:06 -0500
• Organization: University of Maryland, Baltimore County
• Sender: owner-wri-mathgroup at wolfram.com

```In article <4ibblj\$fep at ralph.vnet.net>,
Peter Foldiak  <Peter.Foldiak at st-andrews.ac.uk> wrote:
>On my Unix (SG) version of Mathematica I get this strange
>behaviour:

[snip]

>The book says "Round rounds numbers of the form x.5 towards 0."
>Well, sometimes, it appears. Am I doing something wrong or is this a
>bug?

For rational numbers, Round[] rounds to the even integer.

In:=
Round[ 3/2 ]
Out=
2
In:=
Round[ 5/2 ]
Out=
2

But in the alternative universe of decimal fractions,
Round[] rounds toward 0, as stated in
"Mathematica: A System for Doing Ontology by Computer."

In:=
Round[ 3/2 // N ]
Out=
1
In:=
Round[ 5/2 // N ]
Out=
2

Thus, reality depends on which universe you occupy.

--
Bob Hall            | "Know thyself? Absurd direction!
rhall2 at gl.umbc.edu  |  Bubbles bear no introspection."  -Khushhal Khan Khatak

==== [MESSAGE SEPARATOR] ====

```

• Prev by Date: Re: Re-evaluation of Conditional expressions
• Next by Date: Problem: Prompt 'INPUT' disappears
• Previous by thread: Round[1.5] != Round[3/2] = 2 ???