org.jlab.groot.math
Class StatNumber
- java.lang.Object
-
- org.jlab.groot.math.StatNumber
-
public class StatNumber extends java.lang.ObjectCreates a StatNumber object with a number and an error.
-
-
Constructor Summary
Constructors Constructor and Description StatNumber()Creates a default StatNumber object with a number and error set to 0.0.StatNumber(double num)Creates a StatNumber object with the specified number and calculates its error.StatNumber(double num, double err)Creates a StatNumber object with the specified number and error.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(StatNumber num)Adds two StatNumber objects.voiddivide(StatNumber num)Divides the current object by the parameter StatNumberdoubleerror()voidmultiply(StatNumber num)Multiplies the parameter and the current StatNumberdoublenumber()voidset(double num, double err)Sets the number and error of the StatNumber objectvoidsubtract(StatNumber num)Subtracts the parameter from the current object
-
-
-
Constructor Detail
-
StatNumber
public StatNumber()
Creates a default StatNumber object with a number and error set to 0.0.
-
StatNumber
public StatNumber(double num, double err)Creates a StatNumber object with the specified number and error.- Parameters:
num- The numbererr- The error
-
StatNumber
public StatNumber(double num)
Creates a StatNumber object with the specified number and calculates its error.- Parameters:
num- What number to store in the StatNumber object.
-
-
Method Detail
-
set
public void set(double num, double err)Sets the number and error of the StatNumber object- Parameters:
num- What to set the number toerr- What to set the error to
-
number
public double number()
- Returns:
- the number stored in the StatNumber object.
-
error
public double error()
- Returns:
- the error stored in the StatNumber object.
-
add
public void add(StatNumber num)
Adds two StatNumber objects.- Parameters:
num- The StatNumber to add to this object.
-
divide
public void divide(StatNumber num)
Divides the current object by the parameter StatNumber- Parameters:
num- The StatNumber to divide this object by
-
multiply
public void multiply(StatNumber num)
Multiplies the parameter and the current StatNumber- Parameters:
num- The StatNumber object to multiply this object by
-
subtract
public void subtract(StatNumber num)
Subtracts the parameter from the current object- Parameters:
num- The StatNumber to subtract from the current StatNumber object
-
-
DMelt 3.0 © DataMelt by jWork.ORG