C++ Reference: Standard C++ Library reference: C Library: cfenv

C++官方参考链接:https://cplusplus.com/reference/cfenv/

头文件
<cfenv> (fenv.h)

浮点环境 
此头文件声明了一组用于访问浮点环境的函数和宏,以及特定的类型
浮点环境维护一系列状态标志和特定的控制模式。具体关于浮点环境的内容取决于实现,但状态标志通常包括浮点异常及其相关信息控制模式至少包括舍入方向

函数
浮点异常

feclearexcept

Clear floating-point exceptions (function)(清除浮点异常(函数)) 

feraiseexcept

Raise floating-point exception (function)(引发浮点异常(函数)) 

fegetexceptflag

Get floating-point exception flags (function)(获取浮点异常标志(函数)) 

fesetexceptflag

Set floating-point exception flags (function)(设置浮点异常标志(函数)) 

舍入方向

fegetround

Get rounding direction mode (function)(获取舍入方向模式(函数)) 

fesetround

Set rounding direction mode (function)(设置舍入方向模式(函数)) 

整个环境

fegetenv

Get floating-point environment (function)(获取浮点环境(函数)) 

fesetenv

Set floating-point environment (function)(设置浮点环境(函数))

feholdexcept

Hold floating-point exceptions (function)(保存浮点异常(函数)) 

feupdateenv

Update floating-point environment (function)(更新浮点环境(函数))      

其他

fetestexcept

Test for floating-point exceptions (function)(测试浮点异常(函数))

类型

fenv_t

Floating-point environment type (type)(浮点环境类型(类型)) 

fexcept_t

Floating-point exceptions type (type)(浮点异常类型(类型))

宏常量
浮点异常

FE_DIVBYZERO

Pole error exception (macro)(极点错误异常(宏)) 

FE_INEXACT

Inexact result exception (macro)(不精确结果异常(宏)) 

FE_INVALID

Invalid argument exception (macro)(无效实参异常(宏)) 

FE_OVERFLOW

Overflow range error exception (macro)(上溢范围错误异常(宏)) 

FE_UNDERFLOW

Underflow range error exception (macro)(下溢范围错误异常(宏)) 

FE_ALL_EXCEPT

All exceptions (macro)(所有异常(宏))

舍入方向

FE_DOWNWARD

Downward rounding direction mode (macro)(向下舍入方向模式(宏)) 

FE_TONEAREST

To-nearest rounding direction mode (macro)(向最近舍入方向模式(宏)) 

FE_TOWARDZERO

Toward-zero rounding direction mode (macro)(向零舍入方向模式(宏)) 

FE_UPWARD

Upward rounding direction mode (macro)(向上舍入方向模式(宏))    

整个环境

FE_DFL_ENV

Default environment (macro)(默认环境(宏))

Pragmas

FENV_ACCESS

Access to Floating-point environment (pragma)(访问浮点环境(pragma)) 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
C++ Standard Library Quick Reference by Peter Van Weert, Marc Gregoire 2016 | ISBN: 1484218752 | English | 206 pages PDF+EPUB This quick reference is a condensed reference guide to the essential data structures, algorithms, and functions provided by the C++ Standard Library. More specifically, this is a compact collection of essential classes and functions, used by C++ programmers on a daily basis. The C++ Standard Library Quick Reference features core classes for strings, I/O streams, and various generic containers, as well as a comprehensive set of algorithms to manipulate them. In recent years, the C++11 and C++14 standards have added even more efficient container classes, a new powerful regular expression library, and a portable multithreading library featuring threads, mutexes, condition variables, and atomic variables. Needless to say, it is hard to know and remember all the possibilities, details, and intricacies of this vast and growing library. This handy reference guide is therefore indispensable to any C++ programmer. It offers a condensed, well-structured summary of all essential aspects of the C++ Standard Library, including all aforementioned functionality. No page-long, repetitive examples or obscure, rarely used features. Instead, everything you need to know and watch out for in practice is outlined in a compact, to-the-point style, interspersed with well-chosen, clarifying examples. The book does not explain the C++ language or syntax, but is accessible to anyone with basic C++ knowledge. Even the most experienced C++ programmer though will learn a thing or two from it and find it a useful memory-aid. What You Will Learn • The essentials that the C++ Standard Library has to offer • How to use containers to efficiently store and retrieve your data • How to use algorithms to inspect and manipulate your data • How lambda expressions allow for elegant use of algorithms • What the standard string class provides and how to use it • What functionality the library provides for file and stream-based I/O • What smart pointers are and how to use them to prevent memory leaks • How to write safe and efficient multi-threaded code using the C++11 threading libraries

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

weixin_40186813

你的能量无可限量。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值