code: func (a int64Amount) Cmp(b int64Amount) int {
  	switch {
  	case a.scale == b.scale:
  		// compare only the unscaled portion
  	case a.scale > b.scale:
  		result, remainder, exact := divideByScaleInt64(b.value, a.scale-b.scale)
  		if !exact {
  			return a.AsDec().Cmp(b.AsDec())
  		}
  		if result == a.value {
  			switch {
  			case remainder == 0:
  				return 0
  			case remainder > 0:
  				return -1
  			default:
  				return 1
  			}
  		}
  		b.value = result
  	default:
  		result, remainder, exact := divideByScaleInt64(a.value, b.scale-a.scale)
  		if !exact {
  			return a.AsDec().Cmp(b.AsDec())
  		}
  		if result == b.value {
  			switch {
  			case remainder == 0:
  				return 0
  			case remainder > 0:
  				return 1
  			default:
  				return -1
  			}
  		}
  		a.value = result
  	}
  
  	switch {
  	case a.value == b.value:
  		return 0
  	case a.value < b.value:
  		return -1
  	default:
  		return 1
  	}
  }
docs: // Cmp returns 0 if a and b are equal, 1 if a is greater than b, or -1 if a is less than b.