# eps

## 语法

``d = eps``
``d = eps(x)``
``d = eps(datatype)``
``d = eps("like",p)``

## 说明

``d = eps` 返回从 `1.0` 到下一个较大双精度数的距离，即 2-52。`

``d = eps(x)`（其中，`x` 的数据类型为 `single` 或 `double`）返回从 `abs(x)` 到与 `x` 精度相同的下一个较大浮点数的正距离。如果 `x` 的类型为 `duration`，则 `eps(x)` 返回下一个较大 `duration` 值。命令 `eps(1.0)` 等同于 `eps`。`

``d = eps(datatype)` 根据 `datatype` 指定的数据类型返回 `eps`，该数据类型可以是 `"double"` 或 `"single"`。语法 `eps("double")`（默认值）等效于 `eps`，并且 `eps("single")` 等效于 `eps(single(1.0))`。`

``d = eps("like",p)` 返回从 `1.0` 到与浮点变量 `p` 具有相同精度的下一个更大的浮点数的正距离，具有与 `p` 相同的数据类型、稀疏性和复/实性（实数或复数）。`

## 示例

`d = eps`
```d = 2.2204e-16 ```

`eps` 等效于 `eps(1.0)``eps("double")`

`d = log2(eps)`
```d = -52 ```

`d = eps(10.0)`
```d = 1.7764e-15 ```

`d = eps("single")`
```d = single 1.1921e-07 ```

`eps("single")` 等效于 `eps(single(1.0))`

`d = log2(eps("single"))`
```d = single -23 ```

`d = eps(single(10.0))`
```d = single 9.5367e-07 ```

`p = single([0.12+2i -0.5i 3]);`

`d = eps("like",p)`
```d = single 1.1921e-07 + 0.0000e+00i ```

`p = sparse(10,10,pi);`

`d = eps("like",p)`
```d = (1,1) 2.2204e-16 ```

## 输入参数

• `eps("double")` 等效于 `eps``eps(1.0)`

• `eps("single")` 等效于 `eps(single(1.0))``single(2^-23)`