Square Root

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Business Rules > Business rules examples > Perform Math operations >

Square Root

Overview

This function obtains the square root of a number

 

CHelper.Math.Sqrt(Number)

 

The parameter of this function can be defined as an XPath, variable or number.

 

Considerations

Input parameters must be double.

The supported attribute types to use as input XPath parameter (or Xpaths stored in variables) are: integer, currency, float, real.

The function returns an error if the input parameter is either too long or undefined.

The function returns an error if the input parameter is negative.

Use the IsNaN function to validate the parameter is a number.

 

Example

A company uses Bizagi to manage their logistics processes. One of these is Inventory management. In one of the activities of this process it is necessary to calculate the economic quantity order of a product. This quantity can be obtained by using following formula:

 

Math17

 

Where Q* is the optimal quantity to order, D is the annual demand of the product, K is fixed cost per order and h is the annual holding cost per unit.

 

This quantity can be calculated in Bizagi by using the Sqrt function:

 

Math18

 

//Obtain the parameters of the formula in variables

D = <InventoryManagement.Demand>;

K = <InventoryManagement.OrderCost>;

h = <InventoryManagement.HoldingCost>;

//Calculate the economic quantity order

<InventoryManagement.EconomicQuantityOrder> = CHelper.Math.Sqrt(2*D*K / h);