This project is read-only.
Integer Arithmetic

Category:
Arithmetic
Description: This sample shows some basic integer arithmetic
Code:
let SampleArithmetic1() =
let x = 10 + 12 - 3
let y = x * 2 + 1
let r1,r2 = x/3, x%3
printfn "x = %d, y = %d, r1 = %d, r2 = %d" x y r1 r2


Execution Result:
x = 19, y = 39, r1 = 6, r2 = 1

Last edited Sep 14, 2011 at 3:22 AM by ttliu2000, version 1

Comments

No comments yet.