2017-03-05 10:42:27 +00:00
|
|
|
package com.bytezone.diskbrowser.visicalc;
|
|
|
|
|
|
|
|
public class Sqrt extends Function
|
|
|
|
{
|
|
|
|
private final Expression source;
|
|
|
|
|
2017-03-18 08:33:40 +00:00
|
|
|
Sqrt (Cell cell, String text)
|
2017-03-05 10:42:27 +00:00
|
|
|
{
|
2017-03-18 08:33:40 +00:00
|
|
|
super (cell, text);
|
2017-03-14 11:28:52 +00:00
|
|
|
source = new Expression (parent, cell, text.substring (5, text.length () - 1));
|
2017-03-05 10:42:27 +00:00
|
|
|
values.add (source);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void calculate ()
|
|
|
|
{
|
|
|
|
source.calculate ();
|
|
|
|
|
|
|
|
if (!source.isValueType (ValueType.VALUE))
|
|
|
|
{
|
|
|
|
valueType = source.getValueType ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
value = Math.sqrt (source.getValue ());
|
|
|
|
valueType = ValueType.VALUE;
|
|
|
|
}
|
|
|
|
}
|