BT Lang
首页
动态
文档
关于
留言
更新记录
登录
介绍
环境搭建
如何使用
代码示例
桌面开发
快速开始
app.json 配置
入口配置
运行模式
bt:// 协议
桌面 API
打包构建
发布分发
完整示例
常见问题
语法说明
输出
使用注释
声明变量
解构赋值
声明常量
数据类型
字符串模板
运算符
条件语句
Number数字操作
len
to_number
to_fixed
to_string
to_radix
to_char
to_exponential
String字符串操作
len
trim
char_at
char_code_at
parse_json
parse_radix_int
parse_radix_str
concat
ends_with
contains
index_of
last_index_of
repeat
replace
search
match
slice
split
starts_with
substr
to_lowercase
to_uppercase
to_number
to_string
escape_html
unescape_html
strip_html
Array数组操作
len
to_string
join
each
pop
at
push
shift
unshift
insert
sort
reverse
slice
splice
concat
contains
index_of
last_index_of
find
find_index
find_last
find_last_index
every
some
filter
map
reduce
reduce_right
fill
flat
flat_map
keys
values
entries
clone
delete
remove_at
clear
Object对象操作
len
to_string
keys
values
entries
reverse
concat
clone
delete
has_key
each
map
filter
every
some
find
find_key
update
pick
omit
clear
fn函数
Regex正则表达式
test
match
replace
to_string
语法
修饰符
字符类
元字符
重复匹配
空匹配
分组与标志
ASCII 字符类
Unicode支持
循环遍历
For循环
While 循环
Loop 循环
关键字
use
class类
date日期
format
from_string
from_timestamp
from_millis
from_micros
from_nanos
timestamp
timestamp_millis
timestamp_micros
timestamp_nanos
millis
micros
nanos
year
month
day
hour
minute
second
weekday
week
yearday
quarter
to_string
fs文件操作
path
to_string
read
binary
lines
write
prepend
append
size
rename
move
copy
delete
create_dir
create_file
list
is_dir
is_file
is_relative
is_absolute
is_symlink
is_exists
basename
filename
extension
系统函数
envs
env
has_envs
has_env
pause
assert
print
println
echo
bool
eval
exit
include
include_once
cur_dir
cur_file
cur_root
type
call
number
string
float
int
array
object
json
regex
is_empty
is_null
sleep
rand
web请求上下文
get
post
cookie
session
files
server
url
method
header
status_code
redirect
mysql库
query
bind
binds
batch
workers
all
one
exec
sql
Math库
常量
abs
pow
sqrt
cbrt
min
max
clamp
sign
hypot
round
ceil
floor
trunc
exp
exp2
expm1
ln
log
log10
log2
log1p
sin
cos
tan
asin
acos
atan
atan2
rad
deg
sinh
cosh
tanh
asinh
acosh
atanh
random
md5库
write
ok
sum
to_string
base64库
encode
decode
to_string
reqwest库
method
header
cookie
cookie_store
body
json
form
multipart
timeout
query
proxy
redirect_policy
send
net网络通信
listen
connect
resolve
interfaces
local_ip
Web 服务
TCP 通信
UDP 通信
WebSocket 通信
常见问题
device硬件设备
open
scan
list
exists
serial.read
serial.write
serial.flush
serial.close
扫描串口
串口通信
常见问题
process库
arg
args
env
envs
current_dir
stdin
stdin_write
inherit_stdio
null_stdio
env_clear
env_remove
get_args
get_current_dir
get_envs
get_program
status
exit_status
output
child
pid
kill
wait
try_wait
stdout
stdout_read
stdout_read_lines
stderr_read
stderr_read_lines
child_running
BT编程语言文档
Math.rad
功能
角度转弧度。返回对应弧度值。
语法
Math.rad(degree)
参数
参数
类型
必填
默认值
说明
degree
Number
是
无
角度值。
返回值
类型
说明
Int/Float
返回对应弧度值。整数结果返回 Int,非整数或非有限结果返回 Float。
示例
result = Math.rad(180) // 输出:3.141592653589793 print result
注意事项
等价于 degree * PI / 180。