⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fnmath.hpp

📁 浮点数基本运算 浮点数的基本运算主要有四则运算、符号处理、大小比较
💻 HPP
字号:
// Float number math implementation -*- C++ -*-

// Copyright (C) 2005 Ben T. Bear
//
// This file is published under GNU GPL 2.0. See more in "copy.hpp".

// #include "copy.hpp"

#ifndef __bt2il_fn_math_hpp
#define __bt2il_fn_math_hpp

#include "fn.hpp"
#include "fnexp.hpp"

namespace btil
{
  namespace fn
  {
    template <int n>
    struct factorial;

    template <typename a, typename q, int n>
    struct geometric;


    
    
    template <int n>
    struct factorial
    {
      struct value
      {
	static const double f_val = __factorial<n>::f_val;
      };
    };



    template <typename a, typename q, int n>
    struct geometric
    {
      struct value
      {
	static const double f_val = (a::f_val * (1 - pow_n<q, n>::value::f_val)
				     / (1 - q::f_val));
      };
    };
  }
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -