boost::mpl::Rational Constant

# Rational Constant

### Description

A Rational Constant is a class representing the ration of two values of a built-in integral type (`bool`, `int`, `long`, etc.) in compile-time programs. A rational constant directly supports access to the numerator and denominator. Other arithmetic operations are supported through the external metafunctions. A rational constant is always stored in simplified form.

### Valid expressions

Expression | Return type
--- | ---
`typename n::integer_type` | An integral type
`typename n::type` | A model of Rational Constant
`typename n::numerator` | A model of Integral Constant representing the numerator
`typename n::denominator` | A model of Integral Constant representing the denominator
`n::value()` | A run-time floating point approximation of `n::type`

### Expression semantics

Expression | Complexity | Precondition | Semantics | Postcondition
--- | --- | --- | --- | ---

### Models

- `rational_c`

### See also

Integral Constant, `rational_c`

Table of Contents
Last edited October 30, 2003 2:43 am