本页内容

执行计算

要在定位器中进行基本计算:

  1. Ctrl+K(macOS 上为Cmd+K)激活定位器。
  2. 输入= ,然后按空格键。

    定位器过滤器列表

  3. 进行计算。

在输入项间导航,然后按Enter 键将结果复制到剪贴板

内置函数

除了简单的数学运算(如 ((1 + 2) * 3))外,还提供以下内置函数:

函数用途
abs(x)返回 x 的绝对值
acos(x)返回 x 的反正弦值(单位为弧度)
asin(x)返回 x 的反正弦值,单位为弧度
atan(x)返回 x 的反正切值,单位为弧度
atan2(x, y)返回其两个参数之商的反正切值
bin(x)返回 x 的二进制表示
ceil(x)返回 x 向上舍入到下一个整数的值
cos(x)返回 x 的余弦值(x 以弧度为单位)
exp(x)返回 E 的 x 次幂
e()返回欧拉常数 E(2.71828...)
floor(x)返回 x 向下取整后的整数值
hex(x)返回 x 的十六进制表示形式
log(x)返回 x 的自然对数(底为 E)
max([value1[, value2[, ...]]])返回给定数值中的最大值
min([value1[, value2[, ...]]])返回给定数值中的最小值
oct(x)返回 x 的八进制表示
pi()返回 π(3.14159...)
pow(x, y)返回 x 的 y 次幂
random()返回一个介于 0 和 1 之间的随机数
round(x)返回 x 向右取整后的值
sin(x)返回 x 的正弦值(x 以弧度为单位)
sqrt(x)返回 x 的平方根
tan(x)返回 x 的正切值(x 以弧度为单位)

另请参阅 “使用定位器导航”和“配置定位器”。

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.