Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Z.Dragon
unidocs-zh
提交
bfa7359b
U
unidocs-zh
项目概览
Z.Dragon
/
unidocs-zh
与 Fork 源项目一致
Fork自
DCloud / unidocs-zh
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bfa7359b
编写于
5月 04, 2023
作者:
杜庆泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update syntax-uts.md
上级
12306c2b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
18 deletion
+18
-18
docs/tutorial/syntax-uts.md
docs/tutorial/syntax-uts.md
+18
-18
未找到文件。
docs/tutorial/syntax-uts.md
浏览文件 @
bfa7359b
...
...
@@ -2596,7 +2596,7 @@ Math.fround() 可以将任意的数字转换为离它最近的单精度浮点数
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|x|
|√|
√
|x|
```
ts
console
.
log
(
Math
.
fround
(
1.5
));
...
...
@@ -2656,7 +2656,7 @@ Math.log() 函数返回一个数的自然对数。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
log
(
1
));
...
...
@@ -2674,7 +2674,7 @@ Math.log10() 函数返回一个数字以 10 为底的对数。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
log10
(
10
));
...
...
@@ -2695,7 +2695,7 @@ Math.log1p() 函数返回一个数字加 1 后的自然对数 (底为 E), 既log
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
log1p
(
Math
.
E
-
1
));
...
...
@@ -2713,7 +2713,7 @@ Math.log2() 函数返回一个数字以 2 为底的对数。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
log2
(
2
));
...
...
@@ -2734,7 +2734,7 @@ Math.max() 函数返回作为输入参数的最大数字。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
max
(
1
,
3
,
2
));
...
...
@@ -2752,7 +2752,7 @@ Math.min() 函数返回作为输入参数的数字中最小的一个。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
min
(
2
,
3
,
1
));
...
...
@@ -2770,7 +2770,7 @@ Math.pow() 函数返回基数(base)的指数(exponent)次幂,即 base^
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
pow
(
7
,
3
));
...
...
@@ -2813,7 +2813,7 @@ Math.round() 函数返回一个数字四舍五入后最接近的整数。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
round
(
20.49
));
...
...
@@ -2822,10 +2822,10 @@ console.log(Math.round(20.49));
console
.
log
(
Math
.
round
(
20.5
));
// expected output: 21
console
.
log
(
Math
.
r
andom
(
-
20.5
));
console
.
log
(
Math
.
r
ound
(
-
20.5
));
// expected output: -20
console
.
log
(
Math
.
r
andom
(
-
20.51
));
console
.
log
(
Math
.
r
ound
(
-
20.51
));
// expected output: -21
```
...
...
@@ -2837,7 +2837,7 @@ Math.sign() 函数返回一个数字的符号,分别是 1、-1、0,代表的
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
sign
(
3
));
...
...
@@ -2858,7 +2858,7 @@ Math.sin() 函数返回一个数值的正弦值。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
sin
(
0
));
...
...
@@ -2876,7 +2876,7 @@ Math.sinh() 函数返回一个数字 (单位为角度) 的双曲正弦值。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
sinh
(
0
));
...
...
@@ -2894,7 +2894,7 @@ Math.sqrt() 函数返回一个数的平方根。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
function
calcHypotenuse
(
a
:
number
,
b
:
number
):
number
{
...
...
@@ -2919,7 +2919,7 @@ Math.tan() 方法返回一个数值的正切值。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
tan
(
0
));
...
...
@@ -2937,7 +2937,7 @@ Math.tanh() 函数将会返回一个数的双曲正切函数值。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
tanh
(
-
1
));
...
...
@@ -2958,7 +2958,7 @@ Math.trunc() 方法会将数字的小数部分去掉,只保留整数部分。
|JavaScript|Kotlin|Swift|
|:-:|:-:|:-:|
|√|
x
|√
`(3.7.1+)`
|
|√|
√
|√
`(3.7.1+)`
|
```
ts
console
.
log
(
Math
.
trunc
(
13.37
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录