B2Win Suite Documentation (Under Construction)
ContactB2Data
5.2
5.2
  • B2Win Suite Documentation
  • Scripting
    • B2Win Suite Scripting Overview
    • Scripting in B2Data
      • Custom Script Nodes
        • Custom Script
        • Source Script Node (File)
        • Source Script Node (Table)
        • Source Script Node (Object)
        • If-Else Condition
        • Condition Node
      • In DataPrep
      • Properties
      • Workflow Applications
        • Workflow #1
        • Workflow #2
    • Getting Started
    • Language Basics
    • Data Types and Data Structures
      • Primitive Data Types
      • Data Structures
      • SuiteTable
      • Row, Column, StringColumn
    • Non-static Classes
      • Instant Class
      • LocalDateTime
      • LocalDate
      • LocalTime
      • JsonNode Class
      • File Class
    • Static Classes
      • Duration Class
      • Math Class
      • StrictMath Class
      • InstantUtil
      • NumericUtil
      • GeneralDateUtil
      • LocalDateTimeUtil
      • LocalDateUtil
      • LocalTimeUtil
      • DbUtil
      • StateUtil
      • FileUtil
      • JsonUtil
      • HttpUtil
      • NodeInputReader
      • RandomUtil
    • Property Class
    • Context and System
      • Context Class
      • System Class
    • Logging and Configuration
      • Logging
      • Configuration
    • Tutorial
    • Feedback
Powered by GitBook
On this page
  • Constants
  • Methods

Was this helpful?

  1. Scripting
  2. Static Classes

Math Class

The Math Class provides a comprehensive set of mathematical functions and constants for a wide range of mathematical operations. It includes well-known mathematical constants such as 'e' (the base of natural logarithms) and 'pi' (the ratio of a circle's circumference to its diameter). The Math Class also offers methods for tasks like rounding numbers, generating random values, and converting angles between degrees and radians.

Constants

Math.E

The constant representing the mathematical constant 'e,' the base of natural logarithms.

Math.PI

The constant representing the mathematical constant 'pi,' the ratio of the circumference of a circle to its diameter.

Math.DEGREES_TO_RADIANS

A constant for converting angles from degrees to radians.

Math.RADIANS_TO_DEGREES

A constant for converting angles from radians to degrees.

Methods

Math.round(a: number): number

Returns the closest long to the argument a, with ties rounding to positive infinity.

var number = 3.7;
var roundedNumber = Math.round(number); // roundedNumber is now 4

Math.random(): Double

Returns a random double value with a positive sign, greater than or equal to 0.0 and less than 1.0.

var randomNumber = Math.random();
// Generates a random number between 0.0 (inclusive) and 1.0 (exclusive)

Math.nextUp(num: number): number

Returns the floating-point value adjacent to the argument num in the direction of positive infinity.

Math.nextUp(1); // returns 1.0000001 

Math.nextDown(num: number): number

Returns the floating-point value adjacent to the argument num in the direction of negative infinity.

Math.nextDown(1); // returns 0.9999999

Math.sqrt(num: number): double

Returns the square root of a number in a double.

var number = 16;
var squareRoot = Math.sqrt(number); // squareRoot is now 4.0
PreviousDuration ClassNextStrictMath Class

Was this helpful?