Header menu logo FSharp.Core

Checked Module

This module contains the basic arithmetic operations with overflow checks.

Functions and values

Function or value Description

x * y

Full Usage: x * y

Parameters:
    x : ^T1 - The first value.
    y : ^T2 - The second value.

Returns: ^T3 The product of the two input values.
Modifiers: inline
Type parameters: ^T1, ^T2, ^T3

Overloaded multiplication operator (checks for overflow)

x : ^T1

The first value.

y : ^T2

The second value.

Returns: ^T3

The product of the two input values.

x + y

Full Usage: x + y

Parameters:
    x : ^T1 - The first value.
    y : ^T2 - The second value.

Returns: ^T3 The sum of the two input values.
Modifiers: inline
Type parameters: ^T1, ^T2, ^T3

Overloaded addition operator (checks for overflow)

x : ^T1

The first value.

y : ^T2

The second value.

Returns: ^T3

The sum of the two input values.

x - y

Full Usage: x - y

Parameters:
    x : ^T1 - The first value.
    y : ^T2 - The second value.

Returns: ^T3 The first value minus the second value.
Modifiers: inline
Type parameters: ^T1, ^T2, ^T3

Overloaded subtraction operator (checks for overflow)

x : ^T1

The first value.

y : ^T2

The second value.

Returns: ^T3

The first value minus the second value.

~-value

Full Usage: ~-value

Parameters:
    value : ^T - The input value.

Returns: ^T The negated value.
Modifiers: inline
Type parameters: ^T

Overloaded unary negation (checks for overflow)

value : ^T

The input value.

Returns: ^T

The negated value.

byte value

Full Usage: byte value

Parameters:
    value : ^T - The input value.

Returns: byte The converted byte
Modifiers: inline
Type parameters: ^T

Converts the argument to byte. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using Byte.Parse with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.

value : ^T

The input value.

Returns: byte

The converted byte

char value

Full Usage: char value

Parameters:
    value : ^T - The input value.

Returns: char The converted char
Modifiers: inline
Type parameters: ^T

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.

value : ^T

The input value.

Returns: char

The converted char

int value

Full Usage: int value

Parameters:
    value : ^T - The input value.

Returns: int The converted int
Modifiers: inline
Type parameters: ^T

Converts the argument to int. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using Int32.Parse with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.

value : ^T

The input value.

Returns: int

The converted int

int16 value

Full Usage: int16 value

Parameters:
    value : ^T - The input value.

Returns: int16 The converted int16
Modifiers: inline
Type parameters: ^T

Converts the argument to int16. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using Int16.Parse with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.

value : ^T

The input value.

Returns: int16

The converted int16

int32 value

Full Usage: int32 value

Parameters:
    value : ^T - The input value.

Returns: int32 The converted int32
Modifiers: inline
Type parameters: ^T

Converts the argument to int32. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using Int32.Parse with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.

value : ^T

The input value.

Returns: int32

The converted int32

int64 value

Full Usage: int64 value

Parameters:
    value : ^T - The input value.

Returns: int64 The converted int64
Modifiers: inline
Type parameters: ^T

Converts the argument to int64. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using Int64.Parse with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.

value : ^T

The input value.

Returns: int64

The converted int64

nativeint value

Full Usage: nativeint value

Parameters:
    value : ^T - The input value.

Returns: nativeint The converted nativeint
Modifiers: inline
Type parameters: ^T

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.

value : ^T

The input value.

Returns: nativeint

The converted nativeint

sbyte value

Full Usage: sbyte value

Parameters:
    value : ^T - The input value.

Returns: sbyte The converted sbyte
Modifiers: inline
Type parameters: ^T

Converts the argument to sbyte. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using SByte.Parse with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.

value : ^T

The input value.

Returns: sbyte

The converted sbyte

uint16 value

Full Usage: uint16 value

Parameters:
    value : ^T - The input value.

Returns: uint16 The converted uint16
Modifiers: inline
Type parameters: ^T

Converts the argument to uint16. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using UInt16.Parse with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.

value : ^T

The input value.

Returns: uint16

The converted uint16

uint32 value

Full Usage: uint32 value

Parameters:
    value : ^T - The input value.

Returns: uint32 The converted uint32
Modifiers: inline
Type parameters: ^T

Converts the argument to uint32. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using UInt32.Parse with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.

value : ^T

The input value.

Returns: uint32

The converted uint32

uint64 value

Full Usage: uint64 value

Parameters:
    value : ^T - The input value.

Returns: uint64 The converted uint64
Modifiers: inline
Type parameters: ^T

Converts the argument to uint64. This is a direct, checked conversion for all primitive numeric types. For strings, the input is converted using UInt64.Parse with InvariantCulture settings. Otherwise the operation requires an appropriate static conversion method on the input type.

value : ^T

The input value.

Returns: uint64

The converted uint64

unativeint value

Full Usage: unativeint value

Parameters:
    value : ^T - The input value.

Returns: unativeint The converted unativeint
Modifiers: inline
Type parameters: ^T

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.

value : ^T

The input value.

Returns: unativeint

The converted unativeint

Type something to start searching.