# 3.9 数学函数

这些数学函数允许整数和浮点数作为参数。

函数：sin arg Function：cos arg Function：tan arg 这些是基本的三角函数，参数arg 以弧度为单位。

Function：asin arg 值是一个介于 -pi/2 和 pi/2（含）之间的数字，其正弦为arg。如果arg超出范围（在 \[-1, 1] 之外），则返回 NaN。

Function：aso arg 值是一个介于 0 和 pi（含）之间的数字，其余弦为arg。如果arg超出范围（在 \[-1, 1] 之外），则返回 NaN。

Function：atan y \&optional x 值是一个介于 -pi/2 和 pi/2（不包括）之间的数字，其正切为y。如果给出了可选的第二个参数x，则值是向量和 轴之间的弧度角。

Function：exp arg 指数函数；它返回e的 arg 次幂。

Function：log arg \&optional base 此函数返回arg的对数，以 base 为 底。如果不指定base，则使用自然基数 e。如果arg或base为负，则返回 NaN。

函数：expt x y 此函数返回x 的y 次幂。如果两个参数都是整数且y为非负数，则结果为整数；在这种情况下，会出现溢出错误，所以要小心。如果x是有限负数且y是有限非整数，则expt返回 NaN。

Function：sqrt arg 返回arg 的平方根。如果arg是有限的且小于零，则sqrt返回 NaN。

此外，Emacs 定义了以下常用的数学常数：

Variable：float-e 数学常数 e (2.71828…)。

Variable：float-pi 数学常数 pi (3.14159…)。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://emacs-lisp.ivory.cafe/shu-zi/shu-xue-han-shu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
