Run
はA<'T, FromReturn>
のみを受け取る
if then else
で死にそう
Obsolete
…なるほど、考えてもみなかったですね
printfn "%A" (System.IO.Path.GetFileName str)
printfn
では2進出力ができない、ということかもしれません。
module TestBitOperator =
let test a (x:int, y:int) =
match a with
| "and" -> "0b" + System.Convert.ToString(x &&& y, 2).PadLeft(4, '0')
| "or" -> "0b" + System.Convert.ToString(x ||| y, 2).PadLeft(4, '0')
| "xor" -> "0b" + System.Convert.ToString(x ^^^ y, 2).PadLeft(4, '0')
| _ -> failwith "error!"
printfn "%A" (test "and" (0b0101, 0b1100)) // "0b0100"
printfn "%A" (test "or" (0b0101, 0b1100)) // "0b1101"
printfn "%A" (test "xor" (0b0101, 0b1100)) // "0b1001"