dmolony-DiskBrowser/src/com/bytezone/diskbrowser/visicalc/Sqrt.java

28 lines
580 B
Java
Raw Normal View History

2017-03-05 10:42:27 +00:00
package com.bytezone.diskbrowser.visicalc;
public class Sqrt extends Function
{
private final Expression source;
2017-03-14 11:28:52 +00:00
Sqrt (Sheet parent, Cell cell, String text)
2017-03-05 10:42:27 +00:00
{
2017-03-14 11:28:52 +00:00
super (parent, cell, text);
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;
}
}