FSharp.Core


Checked Module

Functions and values

Function or value Description

int8 value

Full Usage: int8 value

Parameters:
    value : ^T

Returns: sbyte
Modifiers: inline
Type parameters: ^T

Converts the argument to signed byte.

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 and invokes a ToSByte method on the input type.

value : ^T
Returns: sbyte
Example


 Checked.int8 -12
Evaluates to -12y.

Example


 Checked.int8 "129"
Throws System.OverflowException.

uint8 value

Full Usage: uint8 value

Parameters:
    value : ^T

Returns: 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() on strings and otherwise requires a ToByte method on the input type.

value : ^T
Returns: byte
Example


 Checked.uint8 12
Evaluates to -12y.

Example


 Checked.uint8 -12
Throws System.OverflowException.