List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 27 1999 1:40pm
Subject:Re: Weird ROUND behaviour
View as plain text  
At 8:32 AM -0500 9/27/99, Juho Tikkala wrote:
>Why doesn't the ROUND function work like it says in the manual? The manual
>says:
>
>mysql> select ROUND(-1.58);
>        -> -2
>mysql> select ROUND(1.298, 0);
>        -> 1
>
>But the reality is something like this:

ROUND() depends on the behavior of the underlying system call.
Apparently that call behaves differently under Windows than under
the UNIX system used to generate the examples in the manual.
(The behavior probably varies among versions of UNIX as well.)


>--clip--
>
>Welcome to the MySQL monitor.  Commands end with ; or \g.
>Your MySQL connection id is 2 to server version: 3.22.22-debug
>
>Type 'help' for help.
>
>mysql> select ROUND(-1.58);
>+--------------+
>| ROUND(-1.58) |
>+--------------+
>|           -1 |
>+--------------+
>1 row in set (0.00 sec)
>
>mysql> select ROUND(1.298, 0);
>+-----------------+
>| ROUND(1.298, 0) |
>+-----------------+
>|               2 |
>+-----------------+
>1 row in set (0.00 sec)
>
>mysql>
>
>--clip--
>
>
>Using the standard Win32 3.22.22 binary distribution (mysqlwin-3.22.22.zip)
>on Windows NT 4.0 Service Pack 5, Pentium II/233, 64 megs of memory.
>
>
>- Juho Tikkala
>
>--- Bytech Computing Oy ----------------------------------------------
>    Uudenmaankatu 44                                  www.bytech.fi
>    00120 Helsinki                                   info@stripped
>    tel (09) 612 7284                        juho.tikkala@stripped
>    fax (013) 415 556
>
>
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail mysql-thread14406@stripped
>
>To unsubscribe, send a message to the address shown in the
>List-Unsubscribe header of this message. If you cannot see it,
>e-mail mysql-unsubscribe@stripped instead.


--
Paul DuBois, paul@stripped
Thread
Weird ROUND behaviourJuho Tikkala27 Sep
  • Re: Weird ROUND behaviourPaul DuBois27 Sep
    • Re: Weird ROUND behaviourMartin Ramsch28 Sep
      • Re: Weird ROUND behaviourThimble Smith28 Sep
  • Re: Weird ROUND behaviourSteve Ruby28 Sep
    • Re: Weird ROUND behaviourMartin Ramsch28 Sep
    • Re: Weird ROUND behaviourMichael Widenius29 Sep
      • Re: Weird ROUND behaviourBob Kline29 Sep
        • Re: Weird ROUND behaviourTonu Samuel29 Sep
          • Re: Weird ROUND behaviourJames Manning29 Sep
        • Re: Weird ROUND behaviourScott Hess29 Sep
        • Re: Weird ROUND behaviourTonu Samuel30 Sep
        • Re: Weird ROUND behaviourScott Hess30 Sep
        • Re: Weird ROUND behaviourTonu Samuel30 Sep