                 (UInt8(newValue & 0b0000_0001 ) << 4)
         }
     }
+
     public var _isCompact: UInt32 {
         get {
             return UInt32(((__lengthAndFlags) & 0b0010_0000) >> 5)


import CoreFoundation

public var NSDecimalMaxSize: Int32 { return 8 }
// Give a precision of at least 38 decimal digits, 128 binary positions.

public var NSDecimalNoScale: Int32 { return Int32(Int16.max) }

public struct Decimal {
    fileprivate static let maxSize: UInt32 = UInt32(NSDecimalMaxSize)
    fileprivate var __exponent: Int8
    fileprivate var __lengthAndFlags: UInt8
    fileprivate var __reserved: UInt16
    public var _exponent: Int32 {
        get {
            return Int32(__exponent)

    }
}

// MARK: - Internal (Swifty) functions

extension Decimal {
    fileprivate static let maxSize: UInt32 = UInt32(NSDecimalMaxSize)

    fileprivate init(length: UInt32, mantissa: (UInt16, UInt16, UInt16, UInt16, UInt16, UInt16, UInt16, UInt16)) {
        self._mantissa = mantissa
        self.__exponent = 0
        self.__lengthAndFlags = 0
        self.__reserved = 0
        self._length = length
    }

    fileprivate var isCompact: Bool {
        get {
            return _isCompact != 0
