public short getMinimumDifference_as_short(){
        short diff = (short)0;
        if(this.type==8 || this.type==9){
            ArrayMaths am = this.sort();
            short[] sorted = am.getArray_as_short();
            diff = (short)(sorted[1] - sorted[0]);
            short minDiff = diff;
            for(int i=1; i<this.length-1; i++){
                diff = (short)(sorted[i+1] - sorted[i]);
                if(diff<minDiff)minDiff = diff;
            }
        }
        else{
            throw new IllegalArgumentException("Minimum difference may only be returned as the same type as the type of the internal array - you are trying to return as short or Short the difference for a " + this.typeName[this.type] +"[] array");
        }
        return diff;
    }