[Home]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_typeAn integral type
typename n::typeA model of Rational Constant
typename n::numeratorA model of Integral Constant representing the numerator
typename n::denominatorA 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

See also

Integral Constant, rational_c


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