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

29 lines
580 B
Java
Raw Normal View History

2017-03-16 01:44:26 +00:00
package com.bytezone.diskbrowser.visicalc;
public class Atan extends Function
{
Atan (Cell cell, String text)
2017-03-16 01:44:26 +00:00
{
super (cell, text);
2017-03-16 01:44:26 +00:00
2017-03-18 09:21:11 +00:00
assert text.startsWith ("@ATAN(") : text;
2017-03-19 01:03:57 +00:00
source = cell.getExpressionValue (functionText);
2017-03-18 21:23:44 +00:00
values.add (source);
2017-03-16 01:44:26 +00:00
}
@Override
public void calculate ()
{
2017-03-18 21:23:44 +00:00
source.calculate ();
if (!source.isValueType (ValueType.VALUE))
2017-03-16 01:44:26 +00:00
{
2017-03-18 21:23:44 +00:00
valueType = source.getValueType ();
2017-03-16 01:44:26 +00:00
return;
}
2017-03-18 21:23:44 +00:00
value = Math.atan (source.getValue ());
valueType = Double.isNaN (value) ? ValueType.ERROR : ValueType.VALUE;
2017-03-16 01:44:26 +00:00
}
}