当前位置: 首页 > news >正文

包头网站建设奥北wordpress m3u8

包头网站建设奥北,wordpress m3u8,企业怎样建网站,网站空白页黑链常用数学函数 对给定的浮点值分类 std::fpclassify 定义于头文件 <math.h> #define fpclassify(arg) /* implementation defined */ (C99 起) 归类浮点值 arg 到下列类别中&#xff1a;零、非正规、正规、无穷大、 NaN 或实现定义类别。该宏返回整数值。 忽略 FLT_EV…

常用数学函数

对给定的浮点值分类

std::fpclassify

定义于头文件 <math.h>

#define fpclassify(arg) /* implementation defined */

(C99 起)

归类浮点值 arg 到下列类别中:零、非正规、正规、无穷大、 NaN 或实现定义类别。该宏返回整数值。

忽略 FLT_EVAL_METHOD :即使以多于参数类型的范围和精度对它求值,首先仍将它转换到其语义类型,然后分类基于该类型:正规的 long double 值可能在转换到 double 时变为非正规,而在转换到 float 时变为零。

参数

arg-浮点值

返回值

指明 arg 类别的 FP_INFINITE 、 FP_NAN 、 FP_NORMAL 、 FP_SUBNORMAL 、 FP_ZERO 或实现定义类型之一。

#define FP_NAN		0x0100
#define FP_NORMAL	0x0400
#define FP_INFINITE	(FP_NAN | FP_NORMAL)
#define FP_ZERO		0x4000
#define FP_SUBNORMAL	(FP_NORMAL | FP_ZERO)

可能实现

namespace GGX
{
using namespace std;
constexpr int
fpclassify(float __x)
{return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,FP_SUBNORMAL, FP_ZERO, __x);
}constexpr int
fpclassify(double __x)
{return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,FP_SUBNORMAL, FP_ZERO, __x);
}constexpr int
fpclassify(long double __x)
{return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,FP_SUBNORMAL, FP_ZERO, __x);
}template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,int>::__typefpclassify(_Tp __x)
{return __x != 0 ? FP_NORMAL : FP_ZERO;
}
}

调用示例

#include <iostream>
#include <cstdlib>
#include <typeinfo>
#include <cinttypes>
#include <cmath>
#include <math.h>
#include <tgmath.h>
#include <stdio.h>
#include <math.h>
#include <float.h>const char *show_classification(double x)
{//归类浮点值 arg 到下列类别中:零、非正规、正规、无穷大、 NaN 或实现定义类别。switch (std::fpclassify(x)){case FP_INFINITE:return "Inf";case FP_NAN:return "NaN";case FP_NORMAL:return "normal";case FP_SUBNORMAL:return "subnormal";case FP_ZERO:return "zero";default:return "unknown";}
}int main(void)
{std::cout << "show_classification(1.0/0.0) is " << show_classification(1 / 0.0) << std::endl;std::cout << "show_classification(0.0/0.0) is is " << show_classification(0.0 / 0.0) << std::endl;std::cout << "show_classification(DBL_MIN/2) is is " << show_classification(DBL_MIN / 2) << std::endl;std::cout << "show_classification(-0.0 is is) " << show_classification(-0.0) << std::endl;std::cout << "show_classification(1.0 is is) " << show_classification(1.0) << std::endl;std::cout << std::endl;std::cout << "std::fpclassify(1.0/0.0) is " << std::fpclassify(1 / 0.0) << std::endl;std::cout << "std::fpclassify(0.0/0.0) is is " << std::fpclassify(0.0 / 0.0) << std::endl;std::cout << "std::fpclassify(DBL_MIN/2) is is " << std::fpclassify(DBL_MIN / 2) << std::endl;std::cout << "std::fpclassify(-0.0) is " << std::fpclassify(-0.0) << std::endl;std::cout << "std::fpclassify(1.0) is " << std::fpclassify(1.0) << std::endl;std::cout << std::endl;std::cout << std::hex;std::cout << "std::fpclassify(1.0/0.0) is " << std::fpclassify(1 / 0.0) << std::endl;std::cout << "std::fpclassify(0.0/0.0) is is " << std::fpclassify(0.0 / 0.0) << std::endl;std::cout << "std::fpclassify(DBL_MIN/2) is is " << std::fpclassify(DBL_MIN / 2) << std::endl;std::cout << "std::fpclassify(-0.0) is " << std::fpclassify(-0.0) << std::endl;std::cout << "std::fpclassify(1.0) is " << std::fpclassify(1.0) << std::endl;std::cout << std::endl;printf("show_classification(1.0/0.0) is %s\n", show_classification(1 / 0.0));printf("show_classification(0.0/0.0) is %s\n", show_classification(0.0 / 0.0));printf("show_classification(DBL_MIN/2) is %s\n", show_classification(DBL_MIN / 2));printf("show_classification(-0.0) is %s\n", show_classification(-0.0));printf("show_classification(1.0) is %s\n", show_classification(1.0));std::cout << std::endl;return 0;
}

输出

show_classification(1.0/0.0) is Inf
show_classification(0.0/0.0) is is NaN
show_classification(DBL_MIN/2) is is subnormal
show_classification(-0.0 is is) zero
show_classification(1.0 is is) normalstd::fpclassify(1.0/0.0) is 1280
std::fpclassify(0.0/0.0) is is 256
std::fpclassify(DBL_MIN/2) is is 17408
std::fpclassify(-0.0) is 16384
std::fpclassify(1.0) is 1024std::fpclassify(1.0/0.0) is 500
std::fpclassify(0.0/0.0) is is 100
std::fpclassify(DBL_MIN/2) is is 4400
std::fpclassify(-0.0) is 4000
std::fpclassify(1.0) is 400show_classification(1.0/0.0) is Inf
show_classification(0.0/0.0) is NaN
show_classification(DBL_MIN/2) is subnormal
show_classification(-0.0) is zero
show_classification(1.0) is normal

http://www.yayakq.cn/news/683003/

相关文章:

  • 专门教做甜品的网站玉树电子商务网站建设多少钱
  • 泉州免费做网站wordpress tag 打不开
  • 制作微信公众号的网站怎样做网站标题的图标
  • 做网站多久能学会做家教什么网站比较好
  • 上海网站的优化域名怎么和网站绑定
  • 网站建站四件套是什么怎么查网站的备案号
  • 网站网站开发者犯法吗互联网销售模式
  • 娱乐彩票网站建设制作邯郸哪儿做网站好
  • 怎样做能让招聘网站记住密码网站meta标签怎么做
  • 网站建设是否需形成无形资产深圳网站建设与设计制作
  • 网站建设与管理以后工作方向wordpress解决速度
  • 网站天下建设部网站官工程质量手册
  • 适合学生做网站的图片吉林省建设行业继续教续网站
  • 免费网站哪个好seo自然排名关键词来源的优缺点
  • 做网站什么公司做一个网页难不难
  • 广州哪家网站建设最好域名空间都有了怎么做网站
  • 六安做网站做导航网站用什么源码
  • 网站文章内链网站建设学徒
  • 开原网站制作电子系网站建设方案
  • 深圳微信网站公司哪家好晋江论坛网站
  • swiper手机网站案例商城类网站价格
  • 梧州网站开发口碑营销名词解释
  • 对电子商务网站建设的理解阿里巴巴外贸订单网站
  • 百度推广时间段在哪里设置南昌优化网站推广
  • 中国联通网站备案及ip地址备案管理要求国内十大网站排名
  • 如何在电脑里做网站wordpress企业中文主题下载
  • 怎么样做购物网站sqlite做网站数据库
  • 江苏省建设厅网站建造师栏wordpress3.5.1zhcn
  • 站长之家app下载单页面销售网站
  • 福建有没有网站做一件代发在越南做网站需要什么