From c69dfab449a2f1f9c9032c45c204cbe400e5ec03 Mon Sep 17 00:00:00 2001 From: Myun2 Date: Tue, 29 May 2012 17:57:39 +0900 Subject: [PATCH] [_Roast_Math3] math/_ ? --- roast/include/roast/math/_/fraction.hpp | 31 ++++++++++++++++++++++++++++++ roast/include/roast/math/_/square_root.hpp | 27 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 roast/include/roast/math/_/fraction.hpp create mode 100644 roast/include/roast/math/_/square_root.hpp diff --git a/roast/include/roast/math/_/fraction.hpp b/roast/include/roast/math/_/fraction.hpp new file mode 100644 index 00000000..8986b171 --- /dev/null +++ b/roast/include/roast/math/_/fraction.hpp @@ -0,0 +1,31 @@ +// Roast+ License + +/* +*/ +#ifndef __SFJP_ROAST__math__fraction_HPP__ +#define __SFJP_ROAST__math__fraction_HPP__ + +namespace roast +{ + template + class fraction_ + { + protected: + typedef _NumeratorT _NumT; + typedef _DenominatorT _DenoT; + + _NumT m_numerator; + _DenoT m_denominator; + public: + fraction_(const _NumT& numerator, const _DenoT& denominator) + : m_numerator(numerator), m_denominator(denominator){} + + + }; + + ///////////////////// + + typedef fraction_<> fraction, rational; +} + +#endif//__SFJP_ROAST__math__fraction_HPP__ diff --git a/roast/include/roast/math/_/square_root.hpp b/roast/include/roast/math/_/square_root.hpp new file mode 100644 index 00000000..b4df6848 --- /dev/null +++ b/roast/include/roast/math/_/square_root.hpp @@ -0,0 +1,27 @@ +// Roast+ License + +/* +*/ +#ifndef __SFJP_ROAST__math__square_root_HPP__ +#define __SFJP_ROAST__math__square_root_HPP__ + +#include "roast/math/gcd_lcm.hpp" + +namespace roast +{ + template + class square_root_ + { + protected: + T m_root; + public: + square_root_(){} + square_root_(const T& root) : m_root(root){} + }; + + ///////////////////// + + typedef square_root_<> square_root; +} + +#endif//__SFJP_ROAST__math__square_root_HPP__ -- 2.11.0