List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:January 12 2000 9:22pm
Subject:Re: Strange behaviour on GROUP BY
View as plain text  
>>>>> "Sasha" == Sasha Pachev <sasha@stripped> writes:

Sasha> John Cartwright wrote:
>> 
>> The manual seems to have a typo in section 7.4.9 describing the
>> ROUND(X,D) function.  There is a statement that "Note that the return
>> value is converted to a BIGINT!". While I presume that this is true for
>> the ROUND(X) call, It doesn't make sense to me for the
>> ROUND(X,D) call given that it returns a float.  Does it return a float
>> even if called with D=0?

Sasha> You are correct --  the manual is not very clear -- we will make the
Sasha> changes .

Sasha> if D=0 the conversion is to BIGINT:

mysql> select round(3.39,0);
Sasha> +---------------+
Sasha> | round(3.39,0) |
Sasha> +---------------+
Sasha> |             3 |
Sasha> +---------------+
Sasha> 1 row in set (0.00 sec)

Hi!

I just checked the source;  round() is not converted to an integer.
floor() and ceiling() is however converted to integers.

I have now updated the manual with this!

Regards,
Monty
Thread
Strange behaviour on GROUP BYEric A. Kihn11 Jan
  • Re: Strange behaviour on GROUP BYSasha Pachev11 Jan
Re: Strange behaviour on GROUP BYJohn Cartwright12 Jan
  • Re: Strange behaviour on GROUP BYSasha Pachev12 Jan
    • Re: Strange behaviour on GROUP BYMichael Widenius13 Jan