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

Is there a better (shorter?) Way than the following?

let cpucount = System.UInt16.Parse( reader.GetInt32(3).ToString() )
+3
source share
2 answers
let i = uint16 42

see also

MSDN Docs

and section 'casts'

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

+4
source

I do not know F #, but you can write Convert.ToUint16(reader.GetInt32(3)).

EDIT : According to MSDN you can do by typing uint16 reader.GetInt32(3).

+1
source

Source: https://habr.com/ru/post/1736903/


All Articles