Lazarua常用运算符

1. 赋值
变量 := 值;
2.数学运算符有:

运算符 运算功能 操作数类型 结果类型
+ 加法或一元正号 real或integer real或integer
- 减法或一元负号 real或integer real或integer
* 乘法 real或integer real或integer
/ 实数除法 real或integer real
div 整除 integer integer
mod 求模(除法取余) integer integer

3.负号使用
负数需要用()括起来

4.标准函数,其中的三角函数使用的是弧度不是角度(弧度=角度*3.14/180)

函数 描述 参数类型 返回类型
abs 绝对值 实型或整型 与参数同类型
arctan 反正切值 实型或整型 实型
cos 余弦 实型或整型 实型
exp e的次方值 实型或整型 实型
ln 自然对数 实型或整型 实型
round 四舍五入 实型 整型
sin 正弦 实型或整型 实型
sqr 平方 实型或整型 与参数同类型
sqrt 平方根 实型或整型 实型
trunc 舍去法取整 实型或整型 整型

以下是对整数或字符使用

函数 描述 参数类型 返回类型
chr 返回相对应于 ASCII 所指定的字符 整型 字符型
ord 返回字符的 ASCII 码值 整型或字符型 整型
pred 前驱值 整型或字符型 与参数同类型
succ 后继值 整型或字符型 与参数同类型

前驱值和后继值:b的前是a,后是c;5的前是4,后是6;

 

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注