Skip to content

Commit 10ca411

Browse files
Merge pull request #163 from RaymondMcT/patch-1
Otherwise is not a control flow type
2 parents 5d4c012 + d8d2dbe commit 10ca411

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lectures/getting_started_julia/introduction_to_types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ x = BigFloat(1.0)
624624
function g2(x::AbstractFloat)
625625
if x > 0.0 # can't efficiently call with `x::Integer`
626626
return x + 1.0 # OK - assumes you can promote `Float64` to `AbstractFloat`
627-
otherwise
627+
else
628628
return 0 # BAD! Returns a `Int64`
629629
end
630630
end
@@ -639,7 +639,7 @@ x2 = BigFloat(-1.0)
639639
function g3(x) #
640640
if x > zero(x) # any type with an additive identity
641641
return x + one(x) # more general but less important of a change
642-
otherwise
642+
else
643643
return zero(x)
644644
end
645645
end

0 commit comments

Comments
 (0)