What is the difference between `ifelse` and the ternary operator in Julia?

后端 未结 0 1957
闹比i
闹比i 2021-01-16 01:37

Suppose I have this code:

cond = true
a = cond ? 1 : 2
b = ifelse(cond, 1, 2)

What is the difference between the two operations?

相关标签:
回答
  • 消灭零回复
提交回复
热议问题