Opened 18 years ago

Closed 17 years ago

#308 closed Bugs (Fixed)

boost::rational documentation typos(?)

Reported by: nobody Owned by: Jonathan Turkanis
Milestone: Component: None
Version: None Severity:
Keywords: Cc:

Description

<http://www.boost.org/libs/rational/
rational.html#Integer%20Type%20Requirements> states:

"I must be an integer-like type, that is the following expressions must 
be valid for any two values n and m of type I, with the "expected" 
semantics.
[...]
n / m (must truncate, and n/m must be positive if n and m are 
positive)"

I doubt that that is what boost::rational requires.

int n = 1;
int m = 3;
int n_over_m = n/m;

if( n_over_m > 0)
{
    std::cout << "all OK\n";
} else {
    std::cout << "Can't use 'int' as base type for boost::rational\n";
}


<http://www.boost.org/libs/rational/rational.html#Constructors> 
states:

"Rationals can be constructed from a pair (numerator, denominator) 
of integers, or a single integer"

I think that the documentation should read:

"Rationals can be constructed from a pair (numerator, denominator) 
of I's, or a single I"

Change History (2)

comment:1 by Jonathan Turkanis, 17 years ago

Logged In: YES 
user_id=811799

Thanks for your obvservations. I'm planning on rewriting the
implementation of rational for 1.34 (with the help of Andras
Erdei) and will completely rewrite the documentation. I'll
be sure to change the above points

comment:2 by Daryle Walker, 17 years ago

Status: assignedclosed
Logged In: YES 
user_id=551024

I just submitted a fix; please re-open this bug if the
changes are not adequate.  The CVS version of the
fixed file is:
    /cvsroot/boost/boost/libs/rational/rational.html :1.8

Note: See TracTickets for help on using tickets.