java.math.BigDecimal.scale() equivalent for double
<p>I've got a matrix of values like the one below that I need to scale. I've been looking around for an inbuilt function if there is one that could do this for me. I haven't found one &amp; so have ended up writing code to do the scaling using the below formula</p>

<pre><code>scaledMatrix = (Matrix - MeanMatrix)/Standard Deviation
</code></pre>

<p>This code is a bit buggy &amp; I'm working on correcting it. While I do that, I happened to bump on <code>java.math.BigDecimal.scale()</code> &amp; did look up an equivalent for <code>double</code> as the matrix I have is <code>double</code> type numbers</p>

<p>If someone could please help me with details on </p>

<pre><code>1) If there is an inbuilt function that accepts matrix of values &amp; returns me the scaled matrix
2) `java.math.BigDecimal.scale()` equivalent for `double` type data 
</code></pre>

<p>Any help would be much appreciated please.</p>