numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Definition of fraction class. More...
#include <ostream>
#include <type_traits>
#include <fmt/base.h>
#include <fmt/ostream.h>
#include "num_collect/base/concepts/integral.h"
#include "num_collect/base/exception.h"
#include "num_collect/base/precondition.h"
#include "num_collect/logging/logging_macros.h"
#include "num_collect/util/greatest_common_divisor.h"
#include "num_collect/util/multiply_safely.h"
Go to the source code of this file.
Classes | |
struct | fmt::formatter< num_collect::numbers::fraction< Integer > > |
fmt::formatter for num_collect::numbers::fraction. More... | |
class | num_collect::numbers::fraction< IntegerType > |
Class of fractions. More... | |
Namespaces | |
namespace | fmt |
Namespace of fmt library. | |
namespace | num_collect |
Namespace of num_collect source codes. | |
namespace | num_collect::numbers |
Namespace of classes of numbers. | |
Functions | |
template<num_collect::base::concepts::integral Integer> | |
constexpr auto | num_collect::numbers::operator* (const fraction< Integer > &left, const fraction< Integer > &right) -> fraction< Integer > |
Multiply two fractions. | |
template<num_collect::base::concepts::integral Integer> | |
constexpr auto | num_collect::numbers::operator+ (const fraction< Integer > &left, const fraction< Integer > &right) -> fraction< Integer > |
Add two fractions. | |
template<num_collect::base::concepts::integral Integer> | |
constexpr auto | num_collect::numbers::operator- (const fraction< Integer > &left, const fraction< Integer > &right) -> fraction< Integer > |
Subtract a fraction from another fraction. | |
template<num_collect::base::concepts::integral Integer> | |
constexpr auto | num_collect::numbers::operator/ (const fraction< Integer > &left, const fraction< Integer > &right) -> fraction< Integer > |
Divide a fraction by another fraction. | |
template<num_collect::base::concepts::integral Integer> | |
auto | num_collect::numbers::operator<< (std::ostream &stream, const fraction< Integer > &val) -> std::ostream & |
Format a fraction. | |
Definition of fraction class.
Definition in file fraction.h.