
#include <math.h>
#include <iostream>
using namespace std;
#define fn rint
// https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html
#define xstr(s) str(s)
#define str(s) #s
int main() {
const char* name = xstr(fn);
double a[] = { -0.6, -0.5, -0.4, 0.4, 0.5, 0.6 };
for (int i = 0; i < sizeof(a) / sizeof(a[0]); i++) {
double x = a[i];
cout << name << '(' << x << ") = " << fn(x) << endl;
}
}
#include <math.h>
double nearbyint(double x);
float nearbyintf(float x);
long double nearbyintl(long double x);
double rint(double x);
float rintf(float x);
long double rintl(long double x);
double round(double x);
float roundf(float x);
long double roundl(long double x);
double trunc(double x);
float truncf(float x);
long double truncl(long double x);
long lrint(double x);
long lrintf(float x);
long lrintl(long double x);
long long llrint(double x);
long long llrintf(float x);
long long llrintl(long double x);
#include <fenv.h>
int feclearexcept(int excepts);
int fegetexceptflag(fexcept_t *flagp, int excepts);
int feraiseexcept(int excepts);
int fesetexceptflag(const fexcept_t *flagp, int excepts);
int fetestexcept(int excepts);
int fegetround(void);
int fesetround(int rounding_mode);
int fegetenv(fenv_t *envp);
int feholdexcept(fenv_t *envp);
int fesetenv(const fenv_t *envp);
int feupdateenv(const fenv_t *envp);
https://www.codenong.com/32746523/
halfway cases可能是-1.5, -0.5, 0.5, 1.5, 2.5们?halfway可以作副词,case可以做动词, The reactor will be halfway cased in metal. 语法没错吧?:-)

【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
2022-01-09 A Child's History of England.111
2022-01-09 A Child's History of England.110
2022-01-09 除法到底慢不慢?
2022-01-09 anchor
2022-01-09 amount, ample.六级
2022-01-09 amount, ample
2022-01-09 A Child's History of England.109