---
title: llround
description: "基于当前舍入策略，以long long int形式返回舍入值。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengaccel/math-lib/devg-kml/kunpengaccel_kml_0240.html
sourcePath: /source/zh/kunpengaccel/math-lib/devg-kml/kunpengaccel_kml_0240.html
indexId: aea270af5f6049cbb513953d921da1bb42be54677971640c8b195009c0ada4b468
---
# 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
     * */
```
