# ceilDiv

## 语法

``y = ceilDiv(x,d)``
``y = ceilDiv(x,d,m)``

## 说明

``y = ceilDiv(x,d)` 返回 `x/d` 向正无穷方向舍入到最接近的整数值的结果。`

``y = ceilDiv(x,d,m)` 返回 `x/d` 向正无穷方向舍入到 `m` 的最接近倍数的结果。计算 `y` 的数据类型，使得在给定数据类型 `x` 以及 `d` 和 `m` 值的情况下，字长和小数长度的大小足以包含最大和最小可能解。`

## 示例

`ceilDiv(int16(201),10)`
```ans = 21 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 13 FractionLength: 0 ```

`ceilDiv(int16(201),10,5)`
```ans = 25 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 14 FractionLength: 0 ```

```function y = ceilDiv_example(x,d) y = ceilDiv(x,d); end ```

```x = fi(pi); d = fi(2); y = ceilDiv_example(x,d)```
```y = 1 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 2 FractionLength: 0 ```

`codegen ceilDiv_example -args {x, coder.Constant(d)}`
```Code generation successful. ```

```function y = ceilDiv10(x) y = ceilDiv(x,10); end ```
```x = fi(5*pi); y = ceilDiv10(x)```
```y = 1 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 2 FractionLength: 0 ```
`codegen ceilDiv10 -args {x}`
```Code generation successful. ```