public override void ValidateValue(ScalarValue value_Renamed) { if (value_Renamed == null || value_Renamed.Undefined) { return; } if (value_Renamed.ToLong() > maxValue || value_Renamed.ToLong() < minValue) { Global.HandleError(Error.FastConstants.D2_INT_OUT_OF_RANGE, "The value " + value_Renamed + " is out of range for type " + this); } }
public override void ValidateValue(ScalarValue value) { if (value == null || value.IsUndefined) { return; } if (value.ToLong() > _maxValue || value.ToLong() < _minValue) { Global.ErrorHandler.OnError(null, DynError.IntOutOfRange, "The value {0} is out of range for type {1}", value, this); } }
public void TestToLongWithLargeValue() { try { ScalarValue value = String(" 9223372036854775808"); value.ToLong(); Assert.Fail(); } catch (FastException e) { Assert.AreEqual(FastConstants.R4_NUMERIC_VALUE_TOO_LARGE, e.Code); } }
public override byte[] EncodeValue(ScalarValue scalarValue) { long value = scalarValue.ToLong(); int size = GetUnsignedIntegerSize(value); var encoded = new byte[size]; for (int factor = 0; factor < size; factor++) { encoded[size - factor - 1] = (byte) ((value >> (factor*7)) & 0x7f); } return encoded; }
public void TestToLongWithLargeValue() { try { ScalarValue value = String(" 9223372036854775808"); value.ToLong(); Assert.Fail(); } catch (RepErrorException e) { Assert.AreEqual(RepError.NumericValueTooLarge, e.Error); } }
public override byte[] EncodeValue(ScalarValue scalarValue) { long value_Renamed = scalarValue.ToLong(); int size = GetUnsignedIntegerSize(value_Renamed); var encoded = new byte[size]; for (int factor = 0; factor < size; factor++) { encoded[size - factor - 1] = (byte)((value_Renamed >> (factor * 7)) & 0x7f); } return(encoded); }
public override byte[] EncodeValue(ScalarValue value) { long longValue = value.ToLong(); int size = GetSignedIntegerSize(longValue); var encoding = new byte[size]; for (int factor = 0; factor < size; factor++) { int bitMask = (factor == (size - 1)) ? 0x3f : 0x7f; encoding[size - factor - 1] = (byte)((longValue >> (factor * 7)) & bitMask); } // Get the sign bit from the long value and set it on the first byte // 01000000 00000000 ... 00000000 // ^----SIGN BIT encoding[0] |= (byte)((0x40 & (longValue >> 57))); return(encoding); }
public override byte[] EncodeValue(ScalarValue value) { long longValue = value.ToLong(); int size = GetSignedIntegerSize(longValue); var encoding = new byte[size]; for (int factor = 0; factor < size; factor++) { int bitMask = (factor == (size - 1)) ? 0x3f : 0x7f; encoding[size - factor - 1] = (byte) ((longValue >> (factor*7)) & bitMask); } // Get the sign bit from the long value and set it on the first byte // 01000000 00000000 ... 00000000 // ^----SIGN BIT encoding[0] |= (byte) ((0x40 & (longValue >> 57))); return encoding; }
private bool Equals(ScalarValue otherValue) { return(value_Renamed == otherValue.ToLong()); }
public override byte[] EncodeValue(ScalarValue value_Renamed) { return(INTEGER.EncodeValue(new LongValue(value_Renamed.ToLong()))); }
public void TestToLong() { ScalarValue value = String("2147483648"); Assert.AreEqual(2147483648L, value.ToLong()); }
public override byte[] EncodeValue(ScalarValue value) { return(Integer.EncodeValue(new LongValue(value.ToLong()))); }
public override byte[] EncodeValue(ScalarValue value_Renamed) { return INTEGER.EncodeValue(new LongValue(value_Renamed.ToLong())); }
public override byte[] EncodeValue(ScalarValue value) { return Integer.EncodeValue(new LongValue(value.ToLong())); }
public override void ValidateValue(ScalarValue value) { if (value == null || value.IsUndefined) return; if (value.ToLong() > _maxValue || value.ToLong() < _minValue) { Global.ErrorHandler.OnError(null, DynError.IntOutOfRange, "The value {0} is out of range for type {1}", value, this); } }
public override void ValidateValue(ScalarValue value_Renamed) { if (value_Renamed == null || value_Renamed.Undefined) return ; if (value_Renamed.ToLong() > maxValue || value_Renamed.ToLong() < minValue) { Global.HandleError(Error.FastConstants.D2_INT_OUT_OF_RANGE, "The value " + value_Renamed + " is out of range for type " + this); } }
private bool Equals(ScalarValue otherValue) { return value_Renamed == otherValue.ToLong(); }