Java CodeTable of ContentsbcParser.NET
Define Function

Define Custom Function for Math Parser Library

JbcParser Math Parser Java Library allows you to define your own custom functions that take 1 or more parameters.

A function is defined in two steps:

1. Providing an implementation for IFunction interface.

2. Registering an instance of your IFunction implementation with MathParser object.

Below screen shot shows code that defines functions. (Built in functions are defined the same way as user defined functions)

define function

Below screen shot shows how to register your functions using createFunc(...) method:

register functions