KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
F# allows to use checked arithmetics by opening Checked module, which redefines standard operators to be checked operators, for example: open Checked let x = 1 + System.Int32.MaxValue // overflow will result arithmetic overflow exception. But what if I want to use checked arithmetics in some small scope, like C# allows with keyword checked : int x = 1 + int.MaxValue; // ok int y = checked { 1 + int.MaxValue }; // overflow How can I control the scope of operators redefinition by opening Checked module or make it smaller as possible?
Tags (comma-separated)
Save Edits
Cancel