---
name: "__gnu_cxx::subtractive_rng"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_cxx::subtractive_rng"
---

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

## 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.
