--- title: "A/B (LMATH)" slug: "ab-lmath" updated: 2022-10-07T13:15:18Z published: 2022-10-07T13:15:18Z canonical: "docs.datajet.app/ab-lmath" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # A/B (LMATH) ## LMath: A/B ## Divides numeric input A by numeric input B and returns the quotient ## Purpose Use this function to: - Calculate quotients - Divide one number by another ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Low / Med / High / Continuous | | **DataType** | Discrete / Continuous | | **DataSize** | Short / Integer | ```shell Example Return Value: X*...-X* e.g. 20, 98754654, -5, -654 ``` Dividing by zero or null - Dividing by zero will produce a null - Dividing by null will produce a null ![AOverB_Sample](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/AOverB_Sample.PNG) ## Parameters | Parameter | JSON | Description | | --- | --- | --- | | **Table** | “targetTable”: “MyTableName” | The target table on which the new field will be created | | **Filter** | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter recordset will be returned as null. | | **Math** **Function** | “p1”: “A/B” | **A/B** | | **A** | “p2”: “NumericFieldName” “p2”: ““#N*.N*” | Required. The numerator. Accepts Integer or Double. *Supports:* - **DataType:** Discrete / Continuous - **Field Type:** Integer, Double - **Fixed Value:** #N* e.g. #201596, #-87 - **Fixed Value:** #N*.N* e.g. #201596.05, #-87.98 | | **B** | “p3”: “NumericFieldName” “p3”: “#N*.N*” | Required. The denominator. Accepts Integer or Double. *Supports:* - **DataType:** Discrete / Continuous - **Field Type:** Integer, Double - **Fixed Value:** #N* e.g. #201596, #-87 - **Fixed Value:** #N*.N* e.g. #201596.05, #-87.98 | | **Treat Null as Zero** | "nullIsZero": true "nullIsZero": false | True/False. Default = False If true, then any null values in the input fields will be treated as if they have a value of 0. | ## JSON Sample ```json { "method": "BuildBakedField", "project": "BikeData", "targetTable": "worldcities", "overwrite": true, "name": "lat_over_long", "function": "lmath", "p1": "A/B", "p2": "lat", "p3": "lng" } ``` ## Usage Notes A/B (DMATH) returns a decimal (i.e., quotient + remainder), A/B (LMATH) returns an integer (i.e., quotient) See Also: - [A/B (DMATH)](/v1/docs/dmathfunction-2) ## Example | Example | Details | | --- | --- | | **Description** | Divide start station ID by 10 | | **Input** | - Table: = [BikeTripData] - Filter: = [No Filter] - Function: = LMath - **Math Function** **= A/B** - A:= [BikeTripData ].[startStation Id] - B:= #10 - Name: = SSOver10 | | **Sample** | ![AOverB_Example](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/AOverB_Example.PNG) |