public double sqrtAsDouble() {
    if (this.signum == 0) {
      return 0;
    } else if (this.signum < 0) {
      throw new ArithmeticException("sqrt will not be a real number");
    }
    double val = doubleValue();
    return Math.sqrt(val);
  }
Calculate the square root of this value in double precision.
<p>
Note that this does NOT perform the calculation in infinite accuracy.
Although this sounds weird, it's at least how SQLServer does it. The SQL
below demonstrates that SQLServer actually converts it into FLOAT (Java's
double).
</p>
<code>
create table bb (col1 DECIMAL(38,36), col2 DECIMAL (38,36));
insert into bb values(1.00435134913958923485982394892384,1.00345982739817298323423423);
select sqrt(col1) as cola,sqrt(col2) colb into asdasd from bb;
sp_columns asdasd;
</code>
<p>
This SQL tells that the result is in FLOAT data type. One justification is
that, because DECIMAL is at most 38 digits, double precision is enough for
sqrt/pow.
</p>
<p>
This method does not modify this object.
</p>
<p>
This method throws exception if this value is negative rather than
returning NaN. This is the SQL semantics (at least in SQLServer).
</p>

@return square root of this value
common/src/java/org/apache/hadoop/hive/common/type/Decimal128.java