Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor typo and grammar fixes #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions include/real/boundary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ namespace boost {
bool positive = true;

/**
* @brief *default constructor*: It constructs a representation of the number zero.
* @brief *default constructor*: It construct a representation of the number zero.
*/
boundary() = default;

/**
* @brief *Copy constructor:* It constructs a new boost::real::boundary that is a copy of the
* @brief *Copy constructor:* It construct a new boost::real::boundary that is a copy of the
* other boost::real::boundary.
*
* @param other - The boost::real::boundary to copy.
Expand Down Expand Up @@ -109,7 +109,7 @@ namespace boost {
/**
* @brief Generates a string representation of the boost::real::boundary.
*
* @return a string that represents the state of the boost::real::boundary
* @return a string that represent the state of the boost::real::boundary
*/
std::basic_string<char> as_string() const {
std::basic_string<char> result = "";
Expand All @@ -118,7 +118,7 @@ namespace boost {
result = "-";
}

// If the number is too large, scientific notation is used to print it.
// If the number is to large, scientific notation is used to print it.
if ((this->exponent < -10) || (this->exponent > (int)this->digits.size() + 10)) {
result += "0.";

Expand Down Expand Up @@ -247,9 +247,9 @@ namespace boost {
}

/**
* @brief It returns the number of digits of the boost::real::boundary
* @brief It return the amount of digit of the boost::real::boundary
*
* @return an unsigned long representing the number of digits of the boost::real::boundary
* @return an unsigne long representing the number of digits of the boost::real::boundary
*/
unsigned long size() {
return this->digits.size();
Expand Down
2 changes: 1 addition & 1 deletion include/real/boundary_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace boost {
* @param lhs - a std::vector<int> used as the left side operand
* @param rhs - a std::vector<int> used as the right side operand
*
* @return a bool that is true if and only if, the number represented by lsh is lower than
* @return a bool that is true if and only if, the represented number by lsh is lower than
* the represented number by rhs.
*/
bool aligned_vectors_is_lower(const std::vector<int> &lhs, const std::vector<int> &rhs) {
Expand Down
18 changes: 9 additions & 9 deletions include/real/interval.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ namespace boost {
boost::real::boundary upper_bound;

/**
* @brief *default constructor*: It constructs a representation of the interval [0,0].
* @brief *default constructor*: It construct a representation of the interval [0,0].
*/
interval() = default;

/**
* @brief Generates a string representation of the boost::real::interval.
* The string represents the interval with the format [lower boundary, upper boundary]
* The string represent the interval with the format [lower boundary, upper boundary]
*
* @return a string that represents the state of the boost::real::interval.
* @return a string that represent the state of the boost::real::interval.
*/
std::string as_string() const {

Expand All @@ -47,7 +47,7 @@ namespace boost {

/**
* @brief Swaps the lower boundary with the upper boundary. After this method is called
* the boost::real::interval boundaries are swapped.
* the boost::real::interval boundaries are swaped.
*/
void swap_bounds() {
this->lower_bound.swap(this->upper_bound);
Expand Down Expand Up @@ -84,7 +84,7 @@ namespace boost {
*/
bool positive() const {
// If the lower bound of a approximation_interval is positive, then the upper bound is also positive
// and the approximation_interval is fully contained in the positive number line.
// and the approximation_interval is fully contained in the positive number line
return this->lower_bound.positive;
}

Expand All @@ -95,25 +95,25 @@ namespace boost {
*/
bool negative() const {
// If the upper bound of a approximation_interval is negative, then the lower bound is also negative
// and the approximation_interval is fully contained in the negative number line.
// and the approximation_interval is fully contained in the negative number line
return !this->upper_bound.positive;
}

/**
* @brief Equality comparator. Determines if *this is equal or not to other.
*
* @param other - a boost::real::interval to compare to *this.
* @return a bool that is true if and only if *this and other boundaries are equals.
* @return a bool that is true if and only if *this and equal boundaries are equals.
*/
bool operator==(const boost::real::interval& other) const {
return this->lower_bound == other.lower_bound && this->upper_bound == other.upper_bound;
}

/**
* @brief Determines if the interval represents a single number. i.e. the lower and upper
* @brief Determines if the interval represent a single number. i.e. the lower and upper
* boundaries are equals.
*
* @return a bool that is true if and only if the interval represents a single number.
* @return a bool that is true if and only if the interval represent a single number.
*/
bool is_a_number() const {
return this->lower_bound == this->upper_bound;
Expand Down
2 changes: 1 addition & 1 deletion include/real/irrational_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace boost {
* binary integer version.
*
* @param n - The number digit index.
* @return The value of the champernowne number n-th digit (either 0 or 1)
* @return The value if the champernowne number n-th digit (either 0 or 1)
*/
int champernowne_binary_get_nth_digit(unsigned int n) {
std::vector<int> binary = {1};
Expand Down
2 changes: 1 addition & 1 deletion include/real/irrationals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace boost {

/**
* @brief The Champernowne is a transcendental real constant whose digits are formed by
* consecutively concatenated representations of sucessive integers in a determined base.
* consecutively concatenate representations of sucessive integers in a determined base.
* In this function, a binary base is used.
*/
boost::real::real CHAMPERNOWNE_BINARY(boost::real::irrational::champernowne_binary_get_nth_digit, 0);
Expand Down
22 changes: 11 additions & 11 deletions include/real/real.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace boost {
*
* @brief is a forward iterator that iterates a boost::real::real number approximation
* intervals. The iterator calculates the initial interval with the initial precision and
* then it increases the precision in each iteration (++) and recalculates the interval.
* then it increase the precision in each iteration (++) and recalculate the interval.
*/
class const_precision_iterator {
private:
Expand Down Expand Up @@ -294,7 +294,7 @@ namespace boost {
* @brief *Pointer constructor:* Construct a new boost::real::real::const_precision_iterator
* pointing to the boost::real::real number to iterate the number approximation intervals.
*
* The iterator will start pointing to the lowest precision interval.
* The iterator will start pointing the lowest precision interval.
*
* @param real_number - the boost::real::real number to iterate.
*/
Expand Down Expand Up @@ -397,7 +397,7 @@ namespace boost {
};

/**
* @brief It compares by value equality; two boost::real::real::const_precision_iterators
* @brief It compare by value equality; two boost::real::real::const_precision_iterators
* are equals if they are pointing to the same real number and are in the same precision iteration.
*
* @param other - A boost::real::real::const_precision_iterator that is the right side operand
Expand All @@ -413,7 +413,7 @@ namespace boost {
}

/**
* @brief It compares by value not equal; two boost::real::real::const_precision_iterators.
* @brief It compare by value not equal; two boost::real::real::const_precision_iterators.
*
* @param other - A boost::real::real::const_precision_iterator that is the right side operand
* @return a bool that is true if and only if both iterators are not equals.
Expand All @@ -424,10 +424,10 @@ namespace boost {
};

/**
* @brief *Default constructor:* Construct a boost::real::real with undefined representation
* @brief *Default constructor:* Constructr a boost::real::real with undefined representation
* and behaviour.
*
* @note This constructor exists to allow working with other libraries as std::map or std::tuple
* @note This constructor exist to allow working with other libraries as std::map or std::tuple
*/
real() = default;

Expand Down Expand Up @@ -458,7 +458,7 @@ namespace boost {

/**
* @brief *Initializer list constructor:* Creates a boost::real::real_explicit instance
* that represents an integer number where all the digits parameter numbers are from
* that represents an integer number where all the digits parameter numbers are form
* the integer part in the same order. The number is set as positive.
*
* @param digits - a initializer_list<int> that represents the number digits.
Expand All @@ -474,7 +474,7 @@ namespace boost {
* the same order.
*
* @param digits - an initializer_list<int> that represent the number digits.
* @param positive - a bool that represents the number sign. If positive is set to true,
* @param positive - a bool that represent the number sign. If positive is set to true,
* the number is positive, otherwise is negative.
*/
real(std::initializer_list<int> digits, bool positive)
Expand Down Expand Up @@ -722,7 +722,7 @@ namespace boost {
}

/**
* @brief It assigns a new copy of the other boost::real::real number in the *this boost::real::real number.
* @brief It assign a new copy of the other boost::real::real number in the *this boost::real::real number.
*
* @param other - the boost::real::real number to copy.
* @return a reference of *this with the new represented number.
Expand All @@ -736,8 +736,8 @@ namespace boost {
}

/**
* @brief It constructs a boost::real::real number from the std::string and assigns it
* to the *this boost::real::real number.
* @brief It constructs and boost::real::real number from the std::string and assign it
* in the *this boost::real::real number.
*
* @param number - a valid string representing a number.
* @return a reference of *this with the new represented number.
Expand Down
14 changes: 7 additions & 7 deletions include/real/real_algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace boost {
*/
class real_algorithm {

// Number representation as a function that returns the number digits
// Number representation as a function that return the number digits
// an integer part and a sign (+/-)
int (*_get_nth_digit)(unsigned int);
int _exponent;
Expand All @@ -36,7 +36,7 @@ namespace boost {
*
* @brief is a forward iterator that iterates a boost::real::real_algorithm number approximation
* intervals. The iterator calculates the initial interval with the initial precision and
* then it increases the precision in each iteration (++) and recalculates the interval.
* then it increase the precision in each iteration (++) and recalculate the interval.
*/
class const_precision_iterator {
private:
Expand Down Expand Up @@ -77,7 +77,7 @@ namespace boost {
* @brief *Pointer constructor:* Construct a new boost::real::real_algorithm::const_precision_iterator
* pointing to the boost::real::real_algorithm number to iterate the number approximation intervals.
*
* The iterator will start pointing to the lowest precision interval.
* The iterator will start pointing the lowest precision interval.
*
* @param real_number - the boost::real::real number to iterate.
*/
Expand Down Expand Up @@ -152,7 +152,7 @@ namespace boost {
}

/**
* @brief It compares by value equality; two boost::real::real_algorithm::const_precision_iterators
* @brief It compare by value equality; two boost::real::real_algorithm::const_precision_iterators
* are equals if they are pointing to the same real number and are in the same precision iteration.
*
* @param other - A boost::real::real_algorithm::const_precision_iterator that is the right side operand
Expand All @@ -170,7 +170,7 @@ namespace boost {
}

/**
* @brief It compares by value not equal; two boost::real::real_algorithm::const_precision_iterators.
* @brief It compare by value not equal; two boost::real::real_algorithm::const_precision_iterators.
*
* @param other - A boost::real::real_algorithm::const_precision_iterator that is the right side operand
* @return a bool that is true if and only if both iterators are not equals.
Expand Down Expand Up @@ -200,7 +200,7 @@ namespace boost {
* this function returns the n-th number digit. The number is positive.
*
* @param get_nth_digit - a function pointer or lambda function that given an unsigned
* int "n" as parameter, returns the number n-th digit.
* int "n" as parameter, it returns the number n-th digit.
* @param exponent - an integer representing the number exponent.
*/
explicit real_algorithm(int (*get_nth_digit)(unsigned int), int exponent)
Expand All @@ -214,7 +214,7 @@ namespace boost {
* is positive or negative.
*
* @param get_nth_digit - a function pointer or lambda function that given an unsigned
* int "n" as parameter, returns the number n-th digit.
* int "n" as parameter, it returns the number n-th digit.
* @param exponent - an integer representing the number exponent.
* @param positive - a bool that represent the number sign. If positive is set to true,
* the number is positive, otherwise is negative.
Expand Down
2 changes: 1 addition & 1 deletion include/real/real_exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace boost {
struct precision_exception : public std::exception {

const char * what () const throw () override {
return "The boost::real number precision is too slow to compare both numbers";
return "The boost::real number precision is to slow to compare both numbers";
}
};

Expand Down
Loading