我想像这样计算binom:
let t = seq { 1..10 } |> Seq.takeWhile (fun e -> e % 2 == 0)
但编译器抱怨
playground.fsx(27,59): error FS0001: The type 'int' does not support the operator '=='
我做错了什么?
答案 0 :(得分:15)
F#对单个=
使用等于运算符:
let t = seq { 1..10 } |> Seq.takeWhile (fun e -> e % 2 = 0)