math

Advanced mathematical functions and utilities.

Functions

Function
Description
Example

rnd

Generate a random number

dphelper.math.rnd()

tmr

Get current epoch time in seconds

dphelper.math.tmr()

isOdd

Check if a number is odd

dphelper.math.isOdd(a)

percent

Calculate percentage (n/tot * 100)

dphelper.math.percent(n, tot)

isPrime

Check if a number is prime

dphelper.math.isPrime(n)

Description

Mathematical utility functions:

  • Random - Generate random numbers based on time

  • Time - Get epoch timestamp in seconds

  • Number Tests - Check odd/even, prime numbers

  • Percentage - Calculate percentage of value relative to total

Usage Examples

Random Number Generation

Time Measurement

Odd/Even Detection

Percentage Calculation

Prime Number Check

Combined Math Operations

Details

  • Author: Dario Passariello

  • Version: 0.0.2

  • Creation Date: 20210101

  • Last Modified: 20260220

  • Environment: both (browser + Node.js)


Automatically generated document

Last updated