Operations are unchecked by default; the Checked operators live in a separate module.

1
2
3
4
5
6
7
8
9
10
11
12
 

let x = System.Int32.MaxValue 
let y = x + 3
printfn "%d" y

open Checked
let x = System.Int32.MaxValue 
let y = x + 3
printfn "%d" y

By on 2/28/2010 2:38 AM ()

Oddly, though, pown will throw on overflow, which seems like a strange inconsistency.

By on 2/28/2010 3:34 PM ()

For some reason, an OverflowException was being thrown instead of a more helpful one that would have told me that I was calling an array out of bounds.

By on 2/28/2010 6:09 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper