开发者

How to convert from System.Int32 to System.UInt16 in F#

Is there a better (sho开发者_运维知识库rter?) way than the following?

let cpucount = System.UInt16.Parse( reader.GetInt32(3).ToString() )


let i = uint16 42

See also

MSDN docs

and the 'casts' section of

What does this C# code look like in F#?


I don't know F#, but you could write Convert.ToUint16(reader.GetInt32(3)).

EDIT: According to MSDN, you can cast by writing uint16 reader.GetInt32(3).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜