Table of contents
TOC
Collapse the table of content
Expand the table of content

Operators.Checked Module (F#)

Den Delimarsky|Last Updated: 7/19/2016
|
2 Contributors

This module contains the basic arithmetic operations with overflow checks.

Namespace/Module Path: Microsoft.FSharp.Core.Operators

Assembly: FSharp.Core (in FSharp.Core.dll)

Syntax

module Checked

Values

ValueDescription
( * )
: ^T1 -> ^T2 -> ^T3
Overloaded multiplication operator (checks for overflow).
( + )
: ^T1 -> 'T2 -> 'T3
Overloaded addition operator (checks for overflow).
( - )
: ^T1 -> ^T2 -> ^T3
Overloaded subtraction operator (checks for overflow).
( ~- )
: ^T -> ^T
Overloaded unary negation (checks for overflow).
byte
: ^T -> byte
Converts the argument to byte. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using System.Byte.Parse(System.String) with System.Globalization.CultureInfo.InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.
char
: ^T -> char
Converts the argument to char. Numeric inputs are converted using a checked conversion according to the UTF-16 encoding for characters. String inputs must be exactly one character long. For other input types the operation requires an appropriate static conversion method on the input type.
int
: ^T -> int
Converts the argument to int. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using System.Int32.Parse(System.String) with System.Globalization.CultureInfo.InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.
int16
: ^T -> int16
Converts the argument to int16. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using System.Int16.Parse(System.String) with System.Globalization.CultureInfo.InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.
int32
: ^T -> int32
Converts the argument to int32. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using System.Int32.Parse(System.String) with System.Globalization.CultureInfo.InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.
int64
: ^T -> int64
Converts the argument to int64. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using System.Int64.Parse(System.String) with System.Globalization.CultureInfo.InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.
nativeint
: ^T -> nativeint
Converts the argument to nativeint. This is a direct, checked conversion for all primitive numeric types. Otherwise the operation requires an appropriate static conversion method on the input type.
sbyte
: ^T -> sbyte
Converts the argument to sbyte. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using System.SByte.Parse(System.String) with System.Globalization.CultureInfo.InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.
uint16
: ^T -> uint16
Converts the argument to uint16. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using System.UInt16.Parse(System.String) with System.Globalization.CultureInfo.InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.
uint32
: ^T -> uint32
Converts the argument to uint32. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using System.UInt32.Parse(System.String) with System.Globalization.CultureInfo.InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.
uint64
: ^T -> uint64
Converts the argument to uint64. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using System.UInt64.Parse(System.String) with System.Globalization.CultureInfo.InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.
unativeint
: ^T -> unvativeint
Converts the argument to unativeint. This is a direct, checked conversion for all primitive numeric types. Otherwise the operation requires an appropriate static conversion method on the input type.

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Core.Operators Module (F#)

© 2016 Microsoft