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

📄 ch3.11.cc

📁 C++ source code for book-C++ and Object Oriented Numeric computing for scientists and engineers
💻 CC
字号:
#include <cerrno>
#include <cfloat>
#include <iostream>
#include <climits>
#include <cmath>

main() {

using namespace std;

errno = 0;                           // clear old error state. Include <errno.h>
double x = - 50;                     // or x is computed at run time 
double i = sqrt(x);
if (errno == EDOM) cerr << "sqrt() not defined for negative numbers\n";
double p = pow(DBL_MAX, 2);
if (errno == ERANGE) cerr << "result of pow(double,int) overflows\n";

errno = 0;                           // clear old error state. Include <errno.h>
int jj = INT_MAX + 5;
if (errno == ERANGE) cerr << "result of jj overflows\n";

}

⌨️ 快捷键说明

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