pmp.macro.math
Class Const

java.lang.Object
  extended by pmp.AbstractMacro
      extended by pmp.macro.math.Const

public class Const
extends AbstractMacro

Mathematical constants.

Title: PMP: Macroprocessor

Description: Java macroprocessor

Copyright: Copyright (c) 2005

Version:
1.0
Author:
Luděk Hlaváček

Field Summary
static java.lang.String E
          Returns natural log base.
static java.lang.String EULER
          Returns Euler constant.
static java.lang.String I_SQRT_2
          Returns 1 / √2.
static java.lang.String I_SQRT_3
          Returns 1 / √3.
static java.lang.String I_SQRT_PI
          Returns 1 / √π.
static java.lang.String LN_10
          Returns value of ln(10).
static java.lang.String LN_2
          Returns value of ln(2).
static java.lang.String LN_PI
          Returns value of ln(π).
static java.lang.String LOG10_E
          Returns value of log10(e).
static java.lang.String LOG2_E
          Returns value of log2(e).
static int PARAMS_REQUIRED
           
static java.lang.String PI
          Returns value of π.
static java.lang.String PI2
          Returns value of π².
static java.lang.String SQRT_2
          Returns √2.
static java.lang.String SQRT_3
          Returns √3.
static java.lang.String SQRT_PI
          Returns √π.
 
Constructor Summary
Const()
           
 
Method Summary
 java.lang.String run(Macroprocessor mp, java.lang.String[] args)
          Main method of macro.
 
Methods inherited from class pmp.AbstractMacro
getRequiredParams, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMS_REQUIRED

public static final int PARAMS_REQUIRED
See Also:
Constant Field Values

PI

public static final java.lang.String PI
Returns value of π.

See Also:
Constant Field Values

PI2

public static final java.lang.String PI2
Returns value of π².

See Also:
Constant Field Values

E

public static final java.lang.String E
Returns natural log base.

See Also:
Constant Field Values

EULER

public static final java.lang.String EULER
Returns Euler constant.

See Also:
Constant Field Values

SQRT_2

public static final java.lang.String SQRT_2
Returns √2.

See Also:
Constant Field Values

SQRT_3

public static final java.lang.String SQRT_3
Returns √3.

See Also:
Constant Field Values

SQRT_PI

public static final java.lang.String SQRT_PI
Returns √π.

See Also:
Constant Field Values

I_SQRT_2

public static final java.lang.String I_SQRT_2
Returns 1 / √2.

See Also:
Constant Field Values

I_SQRT_3

public static final java.lang.String I_SQRT_3
Returns 1 / √3.

See Also:
Constant Field Values

I_SQRT_PI

public static final java.lang.String I_SQRT_PI
Returns 1 / √π.

See Also:
Constant Field Values

LOG2_E

public static final java.lang.String LOG2_E
Returns value of log2(e).

See Also:
Constant Field Values

LOG10_E

public static final java.lang.String LOG10_E
Returns value of log10(e).

See Also:
Constant Field Values

LN_2

public static final java.lang.String LN_2
Returns value of ln(2).

See Also:
Constant Field Values

LN_10

public static final java.lang.String LN_10
Returns value of ln(10).

See Also:
Constant Field Values

LN_PI

public static final java.lang.String LN_PI
Returns value of ln(π).

See Also:
Constant Field Values
Constructor Detail

Const

public Const()
Method Detail

run

public java.lang.String run(Macroprocessor mp,
                            java.lang.String[] args)
Description copied from class: AbstractMacro
Main method of macro. This method is called when this macro is invoked. All subclasses must imlement this method

Specified by:
run in class AbstractMacro
Parameters:
mp - reference to Macroprocessor
args - parameters of macro. In args[0] is stored name of macro. Subclasses are free to modify this array.
Returns:
result of the macro as String