---
name: "__gnu_cxx::subtractive_rng"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_cxx::subtractive_rng/3cxx"
---

# \_\_gnu\_cxx::subtractive\_rng(3cxx)

## NAME

\_\_gnu\_cxx::subtractive\_rng

## SYNOPSIS

`#include <functional>`

Inherits **std::unary\_function\< unsigned int, unsigned int \>**.

### Public Types

typedef unsigned int **argument\_type**\
 `argument_type` is the type of the argument  typedef unsigned int **result\_type**\
 `result_type` is the return type

### Public Member Functions

**subtractive\_rng** ()\
 Default ctor; initializes its state with some number you don't see.  **subtractive\_rng** (unsigned int \_\_seed)\
 Ctor allowing you to initialize the seed.  void **\_M\_initialize** (unsigned int \_\_seed)\
 unsigned int **operator()** (unsigned int \_\_limit)\
 Returns a number less than the argument.

## Detailed Description

The `subtractive_rng` class is documented on `SGI's site`. Note that this code assumes that `int` is 32 bits.

## Member Typedef Documentation

### typedef unsigned int std::unary\_function\< unsigned int , unsigned int \>::argument\_type` [inherited]`

`argument_type` is the type of the argument

### typedef unsigned int std::unary\_function\< unsigned int , unsigned int \>::result\_type` [inherited]`

`result_type` is the return type

## Constructor & Destructor Documentation

### \_\_gnu\_cxx::subtractive\_rng::subtractive\_rng (unsigned int \_\_seed)` [inline]`

Ctor allowing you to initialize the seed.

### \_\_gnu\_cxx::subtractive\_rng::subtractive\_rng ()` [inline]`

Default ctor; initializes its state with some number you don't see.

## Member Function Documentation

### unsigned int \_\_gnu\_cxx::subtractive\_rng::operator() (unsigned int \_\_limit)` [inline]`

Returns a number less than the argument.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
