Good point, the basic math docs should probably be updated. It is explained 
more clearly in the stdlib docs 
<http://docs.julialang.org/en/release-0.4/stdlib/math/?highlight=round#Base.round>
.

On Tuesday, October 27, 2015 at 9:43:50 PM UTC-4, [email protected] wrote:
>
> Great, thanks Lex.
> The documentation for round 
> <http://docs.julialang.org/en/release-0.4/manual/mathematical-operations/> 
> is "round x to the nearest integer", which seems to be a mathematical 
> definition that isn't quite equivalent to the IEEE spec.
> The docs ought to mention rounding to the nearest.
>
>
> On Wednesday, October 28, 2015 at 12:35:12 PM UTC+11, [email protected] 
> wrote:
>>
>> "round to nearest, ties to even" is the default IEEE floating point 
>> rounding mode 
>> https://en.wikipedia.org/wiki/IEEE_floating_point#Rounding_rules
>>
>> Cheers
>> Lex
>>
>> On Wednesday, October 28, 2015 at 11:02:58 AM UTC+10, [email protected] 
>> wrote:
>>>
>>> Hi there,
>>>
>>> I'm using Julia 0.4.0.
>>>
>>> round(4.5) gives 4.0, i.e. it rounds down.
>>> round(5.5) gives 6.0, i.e. it rounds up.
>>>
>>> Any ideas why this is the case?
>>>
>>> Cheers,
>>> Jock
>>>
>>>

Reply via email to