# jamesrandom

> This algorithm implements the original universal random number generator as proposed by Marsaglia & Zaman in report FSU-SCRI-87-50 and coded in FORTRAN77 by Fred James as the RANMAR generator, part of the MATHLIB HEP library.

Latest version **1.0.5** (published 2016-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install jamesrandom
pnpm add jamesrandom
yarn add jamesrandom
bun add jamesrandom
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2016-01-10 |
| First published | 2016-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Fernando Quinonez |
| Maintainers | quinonez |
| Keywords | Random, Numbers, Generator |

## Links

- npm: https://www.npmjs.com/package/jamesrandom
- Repository: https://github.com/quinonez/JamesRandom
- Homepage: https://github.com/quinonez/JamesRandom#readme
- Issues: https://github.com/quinonez/JamesRandom/issues
- npm.io page: https://npm.io/package/jamesrandom

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2016-01-10
- 1.0.4 — 2016-01-10
- 1.0.2 — 2016-01-10
- 1.0.1 — 2016-01-10
- 1.0.0 — 2016-01-10

## README

# JamesRandom Module
This pseudo random number generator have been written in JavaScript in order to bring 
a better mathematical behavior that it is present in Math.Random built in function.

JamesRandom is based on CLHEP - A Class Library for High Energy Physics, which is written in C++.
This JamesRandom written in JS does not have all the functions that have JamesRandom CLHEP, but it does what it must to do, i.e. 
generates random numbers (by default between 0 and 1).
 

One way to use it is:

```javascript
    var JamesRandom = require('jamesrandom');

    var gen = new JamesRandom({seed: 12345});
    var A = [];
    var sizeA = 40;
    gen.FlatArray( sizeA, A );
    console.log(A);
```



## Public Functions

### Name()
Returns String "HepJamesRandom".
### Flat()
Returns one pseudo random number between 0 and 1.
### FlatArray( size, vect ) 
Where ```size``` is an integer and is intended to be the size of the array ```vect``` of pseudorandom numbers. 
### SetSeed( seed, dum )
Where ```seed``` is an integer and ```dum``` is another integer generally 0.
### SetSeeds( seed, dum )
Where ```seed``` is an integer and ```dum``` is another integer generally 0.


## Static Public Functions

### JamesRandom.EngineName()
Returns String "HepJamesRandom".

### JamesRandom.BeginTag()
Returns String "JamesRandom-Begin".

## Public Variables

Variables that keep the present status of the generator

### u
This is an array of size 97.
### c
Double.
### cd
Double.
### cm
Double.
### i97
Integer.
### j97
Integer.

## Static Public Variables

### JamesRandom.SetMarkerLen = 64

---
_Source: https://npm.io/package/jamesrandom · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
