code: public short shortValue() throws OtpErlangRangeException {
          final long l = longValue();
          final short i = (short) l;
  
          if (i != l) {
              throw new OtpErlangRangeException("Value too large for short: "
                      + val);
          }
  
          return i;
      }
docs: Get this number as a short.
  
  @return the value of this number, as a short.
  
  @exception OtpErlangRangeException
  if the value is too large to be represented as a short.