chrisvoncsefalvay / learn-julia-the-hard-way

Learn Julia the hard way!
https://app.gitbook.com/@chrisvoncsefalvay/s/learn-julia-the-hard-way/
Other
772 stars 153 forks source link

Chapter 6: Control Flow #22

Open sbromberger opened 9 years ago

sbromberger commented 9 years ago

"Value truthiness" - everything here is correct, but perhaps this should be explained:

julia> true * 6
6

julia> true + 8
9

julia> false + 8
8

julia> true + 64.7
65.7

julia> 6 + (true)im
6 + 1im

(That is, true evaluates in numerical contexts to 1, and false to 0.)

chrisvoncsefalvay commented 9 years ago

Thanks! I'll add it.

alemelis commented 6 years ago

The last example for continue in a while-loop is not finished. The last sentence hangs incomplete