npm package: @lbplayground/gitlab-math-utils-oidc-test
Description: A simple math utilities library for testing OIDC trusted publishers with GitLab CI
Author: npm team
Latest version: 1.0.4

# GitLab Math Utils OIDC Test

A comprehensive math utilities library for testing OIDC trusted publishers with GitLab CI and npm.

## Features

- **Calculator**: Basic arithmetic operations (add, subtract, multiply, divide, power, square root)
- **Statistics**: Statistical functions (mean, median, mode, standard deviation, min, max)
- **Constants**: Mathematical constants and conversion utilities
- **ES Modules**: Full ES module support
- **Comprehensive Tests**: Complete test suite with validation

## Installation

```bash
npm install @lbplayground/gitlab-math-utils-oidc-test
```

## Usage

### Quick Start

```javascript
import MathUtils from '@lbplayground/gitlab-math-utils-oidc-test';

const mathUtils = new MathUtils();

// Calculator operations
console.log(mathUtils.calculator.add(5, 3)); // 8
console.log(mathUtils.calculator.power(2, 3)); // 8

// Statistics
const data = [1, 2, 3, 4, 5];
console.log(mathUtils.statistics.mean(data)); // 3
console.log(mathUtils.statistics.standardDeviation(data)); // ~1.58

// Constants
console.log(mathUtils.constants.PI); // 3.14159...
console.log(mathUtils.constants.degreesToRadians(90)); // π/2
```

### Individual Imports

```javascript
import { Calculator, Statistics, MathConstants } from '@lbplayground/gitlab-math-utils-oidc-test';

const calc = new Calculator();
const stats = new Statistics();

// Use individual components
const sum = calc.add(10, 20);
const average = stats.mean([1, 2, 3, 4, 5]);
const piValue = MathConstants.PI;
```

### Calculator Operations

```javascript
import { Calculator } from '@your-org/gitlab-math-utils-oidc-test';

const calc = new Calculator();

calc.add(a, b)           // Addition
calc.subtract(a, b)      // Subtraction
calc.multiply(a, b)      // Multiplication
calc.divide(a, b)        // Division
calc.power(base, exp)    // Exponentiation
calc.sqrt(num)           // Square root
```

### Statistical Functions

```javascript
import { Statistics } from '@lbplayground/gitlab-math-utils-oidc-test';

const stats = new Statistics();
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

stats.mean(data)               // Average
stats.median(data)             // Middle value
stats.mode(data)               // Most frequent value(s)
stats.standardDeviation(data)  // Standard deviation
stats.min(data)                // Minimum value
stats.max(data)                // Maximum value
```

### Mathematical Constants

```javascript
import { MathConstants } from '@lbplayground/gitlab-math-utils-oidc-test';

// Built-in constants
MathConstants.PI              // π
MathConstants.E               // Euler's number
MathConstants.GOLDEN_RATIO    // Golden ratio

// Conversion utilities
MathConstants.degreesToRadians(90)    // Convert 90° to radians
MathConstants.radiansToDegrees(π)     // Convert π radians to degrees
```

## Development

```bash
# Install dependencies
npm install

# Run tests
npm test

# Run demo
npm run demo

# Start CLI
npm start
```

## Command Line Interface

```bash
# Basic package info
npx @lbplayground/gitlab-math-utils-oidc-test

# Run interactive demo
npx @lbplayground/gitlab-math-utils-oidc-test demo
```

## OIDC Testing

This package is specifically designed for testing OIDC trusted publishers with:
- GitLab CI/CD pipelines
- npm package publishing with provenance
- Trusted publisher authentication workflows

## Error Handling

All functions include comprehensive input validation:
- Type checking for numbers and arrays
- Range validation (e.g., no negative square roots)
- Division by zero protection
- Empty array handling

## License

MIT

## Contributing

This package is for OIDC testing purposes. For production math utilities, consider using established libraries like Lodash or Math.js.