---
title: llround
description: "基于当前舍入策略，以long long int形式返回舍入值。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/240RC2/accel/kunpengaccel_kml_16_0688.html
sourcePath: /source/zh/kunpengboostkithistory/240RC2/accel/kunpengaccel_kml_16_0688.html
indexId: 9def2b51e784d2b3dea3986c719f04e2204d576820d1408f36346b2d656efb6976
---
# llround

基于当前舍入策略，以long long int形式返回舍入值。

#### 接口定义

C interface：

long long int llroundf(float x);

long long int llround(double x);

long long int llroundl(long double x);


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| x | 在llroundf中，x是单精度浮点类型。 在llround中，x是双精度浮点类型。 在llroundl中，x是长双精度浮点类型。 | 表示输入数据的浮点值。 | 输入 |


#### 返回值

返回x的舍入值，x ∈ (-inf, inf)。


#### 依赖

C: "km.h"


#### 示例

C interface：
```
// typical usage
printf("llround(0.0) = %lld\n", llround(0.0));
printf("llround(-0.0) = %lld\n", llround(-0.0));
printf("llround(1.0) = %lld\n", llround(1.0));
printf("llround(1.4) = %lld\n", llround(1.4));
printf("llround(1.5) = %lld\n", llround(1.5));
printf("llround(-3.0) = %lld\n", llround(-3.0));
printf("llround(-3.4) = %lld\n", llround(-3.4));
printf("llround(-3.5) = %lld\n", llround(-3.5));
result
/*
* llround(0.0) = 0
* llround(-0.0) = 0
* llround(1.0) = 1
* llround(1.4) = 1
* llround(1.5) = 2
* llround(-3.0) = -3
* llround(-3.4) = -3
* llround(-3.5) = -4
* */
```
