Implementation:SeleniumHQ Selenium Closure Math
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing additional mathematical functions used by Selenium JavaScript atoms.
Description
goog.math is a vendored copy of the Google Closure Library module. It provides additional mathematical functions beyond the native Math object, including randomInt, uniformRandom, clamp, modulo (with correct sign behavior unlike JavaScript's %), and linear interpolation (lerp). Selenium uses this as part of its JavaScript atom infrastructure.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. Not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/math/math.js
- Lines: 1-477
Key Exports
goog.provide('goog.math');
goog.math.randomInt = function(a) { ... };
goog.math.uniformRandom = function(a, b) { ... };
goog.math.clamp = function(value, min, max) { ... };
goog.math.modulo = function(a, b) { ... };