开发者

F# Syntax Question

A bit of a sytax question...

I have the following code in F#

let GetSumOfSequenceAttempt1 : bigint = 
    seq{bigint(1)..bigint(10000000)}
    |> Seq.sum 

I dont what to keep having to place the numb开发者_StackOverflow中文版ers within the bigint() - is there some shorthand that will make this look neater?


Yes:

let GetSumOfSequenceAttempt1 = 
  seq { 1I .. 10000000I }
  |> Seq.sum 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜