Skip to content

NumericRangeCheck Class ​

Definition ​

Provides safe conversion methods between numeric types with strict range and precision checks.

  • Namespace: JASE
  • Assembly: JASE.dll

Methods ​

NameDescription
bool ToInt16(byte value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt16(decimal value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt16(double value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt16(float value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt16(int value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt16(long value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt16(sbyte value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt16(uint value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt16(ulong value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt16(ushort value, out short result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(byte value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(decimal value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(double value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(float value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(int value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(long value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(sbyte value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(short value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(uint value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(ulong value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt32(ushort value, out int result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(byte value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(decimal value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(double value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(float value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(int value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(long value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(sbyte value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(short value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(uint value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(ulong value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToInt64(ushort value, out long result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToSingle(decimal value, out float result)Checks the validity of the input value against the safe range, provides converted result if within the proper range
bool ToSingle(double value, out float result)Checks the validity of the input value against the safe range, provides converted result if within the proper range

Remarks ​

Each method attempts conversion and returns a boolean result, avoiding exceptions on overflow or truncation.