I've been working through the Julia Tutorial, and strangely (1,2,3) returns (1,2,0).
(1,2,3,4) returns (1,2,0,0)
(1,2,3,4,5) returns (1,2,3,4,5) as expected.
It seems that sets of size 3 or 4 replace the 3rd and fourth elements with 0. I don't expect that this is normal behavior but I'm not familiar with the environment so I'm not sure with what I might have done to cause this.
I deleted all julia files from my profile and restarted the interpreter, and the behavior persists.
Version 0.3.5 (2015-01-08 22:33 UTC) under windows executed in cygwin. Same problem when executed from command.
Arrays in the Julia programming language are somewhat different from arrays in other programming languages. Not because of different behavior, but because they are start at 1 instead of 0. It's because Julia is used for mathematics , machine learning and scientific etc.
Conventionally, Julia's arrays are indexed starting at 1, whereas some other languages start numbering at 0, and yet others (e.g., Fortran) allow you to specify arbitrary starting indices.
(11:13, 1:3) . Julia uses end to denote the end of conditional blocks, like if , loop blocks, like while / for , and functions. In lieu of the one-line if ( cond ) statement , Julia allows statements of the form if cond; statement; end , cond && statement and ! cond || statement .
By definition, eps(1.0) is the same as eps(Float64) since 1.0 is a 64-bit floating-point value.
This is a (very strange!) long standing display bug on Windows. You can read about it at the link - in short, the value is correct but it doesn't display right. It should also be fixed in final release of Julia 0.4, which will use LLVM 3.5 (at least, thats what the thread says).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With