I think it's correct because the next value in the range would exceed PI. 
If you try 0:pi/101:pi, you would get 3.14 again.

On Thursday, April 24, 2014 5:59:10 AM UTC+8, Peter Simon wrote:
>
> The first three results below are what I expected.  The fourth result 
> surprised me:
>
> julia> (0:pi:pi)[end]     
> 3.141592653589793         
>                           
> julia> (0:pi/2:pi)[end]   
> 3.141592653589793         
>                           
> julia> (0:pi/3:pi)[end]   
> 3.141592653589793         
>                           
> julia> (0:pi/100:pi)[end] 
> 3.1101767270538954     
>
> Is this behavior correct? 
>
> Version info:
> julia> versioninfo()                                         
> Julia Version 0.3.0-prerelease+2703                          
> Commit 942ae42* (2014-04-22 18:57 UTC)                       
> Platform Info:                                               
>   System: Windows (x86_64-w64-mingw32)                       
>   CPU: Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz       
>   WORD_SIZE: 64                                              
>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)   
>   LAPACK: libopenblas                                        
>   LIBM: libopenlibm                                          
>
>
> --Peter
>
>

Reply via email to