<commit_before>/// @brief provides stuff for std::tan in case of fixed-point numbers

namespace std {
    template<typename T, size_t n, size_t f, class op, class up>
    typename core::fixed_point<T, n, f, op, up>::tan_type tan(core::fixed_point<T, n, f, op, up> const& val)
    {
        typedef core::fixed_point<T, n, f, op, up> fp;

        fp::sin_type const sin = std::sin(val);
        fp::cos_type const cos = std::cos(val);

        if (cos == fp::cos_type(0)) {
            throw std::exception("tan: cos is zero");
        }

        return fp::tan_type(sin / cos);
    }
}<commit_msg>tan.inl: class tan_of<commit_after>/// @brief provides stuff for std::tan in case of fixed-point numbers

#include <boost/type_traits/is_floating_point.hpp>

#include <boost/integer.hpp>

namespace core {
    template<typename T>
    class tan_of
    {
        BOOST_STATIC_ASSERT(boost::is_floating_point<T>::value);

    public:
        typedef T type;
    };

    template<typename T, size_t n, size_t f, class op, class up>
    class tan_of<fixed_point<T, n, f, op, up> >
    {
        typedef fixed_point<T, n, f, op, up> fp_type;

    public:
        typedef typename quotient<
            typename sin_of<fp_type>::type,
            typename cos_of<fp_type>::type
        >::type type;
    };
}

namespace std {
    template<typename T, size_t n, size_t f, class op, class up>
    typename core::tan_of<core::fixed_point<T, n, f, op, up> >::type tan(core::fixed_point<T, n, f, op, up> val)
    {
        typedef core::fixed_point<T, n, f, op, up> fp;

        fp::sin_type const sin = std::sin(val);
        fp::cos_type const cos = std::cos(val);

        if (cos == fp::cos_type(0)) {
            throw std::exception("tan: cos is zero");
        }

        return fp::tan_type(sin / cos);
    }
}
{'fraction_non_alphanumeric': 0.1403216860787576, 'fraction_numerical': 0.0011092623405435386, 'mean_word_length': 2.711934156378601, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6094247', 'n_tokens_mistral': 637, 'n_tokens_neox': 613, 'n_words': 174}