CalcTree Help Pages
  • What is CalcTree?
  • Getting started
    • CalcTree Pages
    • Create a CalcTree Page
    • Add a calculation
    • Collaborate with a colleague
  • Calculations
    • Parameters
      • Math formulas
        • Parameter Data Types
        • Native Functions
          • Arithmetic Functions
          • Trigonometric Functions
          • Logical & Comparison Functions
          • Matrix & Vector Functions
          • Probability & Combinatorics Functions
          • Statistical Functions
          • String Functions
          • Utility Functions
          • Other Native Functions
        • Valid Expression Syntax
      • Supported Units
      • Dropdown List Parameters
        • Linking CSV Data to Dependent Dropdowns in CalcTree
      • Parameter Settings
    • Integrations
      • Python in CalcTree
        • Adding a Python Source
        • Defining Parameters in Python
        • Referencing Other Parameters in Python
        • Working with Units in Python
        • Creating Tables and Visuals in Python
        • Consuming Files in Python
        • Using Pre-installed Python Libraries
      • Spreadsheets [Coming Soon!]
      • File Upload
        • CSV files
      • 3rd Party Software Plugins
        • Excel
        • Grasshopper
        • ETABS [v20 & v21]
        • ETABS [v22]
        • SAP 2000
        • CSI Bridge [v26]
    • Templates [Coming Soon!]
    • Optimising your calculations
  • Pages & Reports
    • CalcTree Documents
    • Static content
    • Parametric content
      • Parametric equation
      • Inputs
      • Outputs
  • Export to PDF
  • API
    • GraphQL API
      • Generating an API key
      • Queries
        • GetCalculation
        • Calculate
      • Examples
        • Bulk calculations with Python
  • Collaborate
    • Add members
    • Review and approval
    • Add stakeholders
  • Administrate
    • CalcTree Workspace
    • Versioning and Audit trail
  • CalcTree for System Administrators
Powered by GitBook
On this page
  • Type & Property Checks
  • Type Introspection
  • Numeric Conversion
  • Notes for CalcTree
  1. Calculations
  2. Parameters
  3. Math formulas
  4. Native Functions

Utility Functions

CalcTree includes several utility functions to help you inspect, validate, or manipulate values. These are especially useful for:

  • Input validation

  • Conditional logic

  • Type checking

  • Ensuring numerical stability in custom calculations

Type & Property Checks

Function
Description
CalcTree Example

isNaN(x)

Check if value is NaN

isNaN(0/0) → true

isZero(x)

Check if value is exactly zero

isZero(0) → true

isPositive(x)

Check if value > 0

isPositive(10) → true

isNegative(x)

Check if value < 0

isNegative(-5) → true

isInteger(x)

Check if value is an integer

isInteger(2.0) → true

isNumeric(x)

Check if value is number or unit

isNumeric("abc") → false

Type Introspection

Function
Description
CalcTree Example

typeOf(x)

Return the type as a string

typeOf(3) → "number"

clone(x)

Return a deep copy of a value

clone([1, 2]) → [1, 2]

Numeric Conversion

Function
Description
CalcTree Example

numeric(x)

Convert value to number (if possible)

numeric("5") → 5

Notes for CalcTree

  • Use these functions inside conditionals or if-style formulas to make your pages more robust.

  • typeOf() can help debug input types from tables or imported files.

  • isNaN() is particularly useful when handling optional or calculated fields that may not resolve.

PreviousString FunctionsNextOther Native Functions

Last updated 1 day ago

📘 Looking for more functions? CalcTree’s expression engine is powered by . For a full list of available functions, visit the . Most functions listed there are supported in CalcTree unless otherwise noted.

MathJS
MathJS Function Reference