当前位置: 首页 > news >正文

fullpage wow做的网站百度下载老版本

fullpage wow做的网站,百度下载老版本,个人公众号做电影网站吗,徐州网站建设培训班文章目录 一、Lua 运算符(一)算术运算符(二)关系运算符(三)逻辑运算符(四)其他运算符 二、运算符优先级 一、Lua 运算符 运算符是一个特殊的符号,用于告诉解释器执行特定…

文章目录

  • 一、Lua 运算符
    • (一)算术运算符
    • (二)关系运算符
    • (三)逻辑运算符
    • (四)其他运算符
  • 二、运算符优先级

一、Lua 运算符

运算符是一个特殊的符号,用于告诉解释器执行特定的数学或逻辑运算。Lua提供了以下几种运算符类型:

(一)算术运算符

表列出了 Lua 语言中的常用算术运算符,设定 A 的值为10,B 的值为 20:
在这里插入图片描述

a = 21
b = 10
c = a + b
print("Line 1 - c 的值为 ", c )
c = a - b
print("Line 2 - c 的值为 ", c )
c = a * b
print("Line 3 - c 的值为 ", c )
c = a / b
print("Line 4 - c 的值为 ", c )
c = a % b
print("Line 5 - c 的值为 ", c )
c = a^2
print("Line 6 - c 的值为 ", c )
c = -a
print("Line 7 - c 的值为 ", c )

在这里插入图片描述
在 lua 中,/ 用作除法运算,计算结果包含小数部分,// 用作整除运算,计算结果不包含小数部分:

a = 5
b = 2print("除法运算 - a/b 的值为 ", a / b )
print("整除运算 - a//b 的值为 ", a // b )

在这里插入图片描述

(二)关系运算符

下表列出了 Lua 语言中的常用关系运算符,设定 A 的值为10,B 的值为 20:
在这里插入图片描述

a = 21
b = 10if( a == b )
thenprint("Line 1 - a 等于 b" )
elseprint("Line 1 - a 不等于 b" )
endif( a ~= b )
thenprint("Line 2 - a 不等于 b" )
elseprint("Line 2 - a 等于 b" )
endif ( a < b )
thenprint("Line 3 - a 小于 b" )
elseprint("Line 3 - a 大于等于 b" )
endif ( a > b ) 
thenprint("Line 4 - a 大于 b" )
elseprint("Line 5 - a 小于等于 b" )
end-- 修改 a 和 b 的值
a = 5
b = 20
if ( a <= b ) 
thenprint("Line 5 - a 小于等于  b" )
endif ( b >= a ) 
thenprint("Line 6 - b 大于等于 a" )
end

在这里插入图片描述

(三)逻辑运算符

在这里插入图片描述

a = true
b = trueif ( a and b )
thenprint("a and b - 条件为 true" )
endif ( a or b )
thenprint("a or b - 条件为 true" )
endprint("---------分割线---------" )-- 修改 a 和 b 的值
a = false
b = trueif ( a and b )
thenprint("a and b - 条件为 true" )
elseprint("a and b - 条件为 false" )
endif ( not( a and b) )
thenprint("not( a and b) - 条件为 true" )
elseprint("not( a and b) - 条件为 false" )
end

在这里插入图片描述

(四)其他运算符

在这里插入图片描述
我们可以通过以下实例来更加透彻的理解连接运算符与计算表或字符串长度的运算符的应用:

a = "Hello "
b = "World"print("连接字符串 a 和 b ", a..b )print("b 字符串长度 ",#b )print("字符串 Test 长度 ",#"Test" )print("长度 ",#"www.wonyoung.com" )

在这里插入图片描述

二、运算符优先级

^
not    - (unary)
*      /       %
+      -
..
<      >      <=     >=     ~=     ==
and
or

除了 ^ 和 … 外所有的二元运算符都是左连接的。

a+i < b/2+1          <-->       (a+i) < ((b/2)+1)
5+x^2*8              <-->       5+((x^2)*8)
a < y and y <= z     <-->       (a < y) and (y <= z)
-x^2                 <-->       -(x^2)
x^y^z                <-->       x^(y^z)
a = 20
b = 10
c = 15
d = 5e = (a + b) * c / d;-- ( 30 * 15 ) / 5
print("(a + b) * c / d 运算值为  :",e )e = ((a + b) * c) / d; -- (30 * 15 ) / 5
print("((a + b) * c) / d 运算值为 :",e )e = (a + b) * (c / d);-- (30) * (15/5)
print("(a + b) * (c / d) 运算值为 :",e )e = a + (b * c) / d;  -- 20 + (150/5)
print("a + (b * c) / d 运算值为   :",e )

在这里插入图片描述


文章转载自:
http://vinous.c7513.cn
http://pilary.c7513.cn
http://paralogize.c7513.cn
http://unipod.c7513.cn
http://coronary.c7513.cn
http://thermophilic.c7513.cn
http://indispose.c7513.cn
http://quarterly.c7513.cn
http://apograph.c7513.cn
http://easiness.c7513.cn
http://ndr.c7513.cn
http://davey.c7513.cn
http://tragedian.c7513.cn
http://wot.c7513.cn
http://legitimatize.c7513.cn
http://humpbacked.c7513.cn
http://mecopteran.c7513.cn
http://holp.c7513.cn
http://catchpoll.c7513.cn
http://dwelling.c7513.cn
http://armpad.c7513.cn
http://ascription.c7513.cn
http://estimation.c7513.cn
http://ecoclimate.c7513.cn
http://ungava.c7513.cn
http://bohemia.c7513.cn
http://lithify.c7513.cn
http://wolves.c7513.cn
http://thud.c7513.cn
http://minifestival.c7513.cn
http://farmer.c7513.cn
http://needlefish.c7513.cn
http://hydrate.c7513.cn
http://insulin.c7513.cn
http://rudderstock.c7513.cn
http://gawker.c7513.cn
http://supplicat.c7513.cn
http://adenoidectomy.c7513.cn
http://repetition.c7513.cn
http://taffarel.c7513.cn
http://haemathermal.c7513.cn
http://repossess.c7513.cn
http://haemospasia.c7513.cn
http://komatsu.c7513.cn
http://diffidence.c7513.cn
http://racism.c7513.cn
http://sistroid.c7513.cn
http://rhizogenesis.c7513.cn
http://endomorph.c7513.cn
http://fortyish.c7513.cn
http://kist.c7513.cn
http://exorcism.c7513.cn
http://incendiarism.c7513.cn
http://regius.c7513.cn
http://mast.c7513.cn
http://humorous.c7513.cn
http://outbid.c7513.cn
http://newspaper.c7513.cn
http://lionize.c7513.cn
http://faitaccompli.c7513.cn
http://harim.c7513.cn
http://wayward.c7513.cn
http://guanaco.c7513.cn
http://svelte.c7513.cn
http://infancy.c7513.cn
http://hypersensitive.c7513.cn
http://breezeway.c7513.cn
http://jingo.c7513.cn
http://nosepipe.c7513.cn
http://drooly.c7513.cn
http://beadroll.c7513.cn
http://insectivora.c7513.cn
http://spartan.c7513.cn
http://aeromagnetic.c7513.cn
http://prelaw.c7513.cn
http://emancipative.c7513.cn
http://annapolis.c7513.cn
http://aletophyte.c7513.cn
http://basque.c7513.cn
http://inning.c7513.cn
http://misspelling.c7513.cn
http://synchronizer.c7513.cn
http://streaking.c7513.cn
http://figment.c7513.cn
http://calamine.c7513.cn
http://shakta.c7513.cn
http://oopm.c7513.cn
http://lived.c7513.cn
http://acrimony.c7513.cn
http://portmanteau.c7513.cn
http://proscenia.c7513.cn
http://telescope.c7513.cn
http://undo.c7513.cn
http://fruited.c7513.cn
http://ideogram.c7513.cn
http://discursiveness.c7513.cn
http://interpolatory.c7513.cn
http://headless.c7513.cn
http://exchequer.c7513.cn
http://caducary.c7513.cn
http://www.zhongyajixie.com/news/74376.html

相关文章:

  • 重庆有哪些做网站的公司chinaz站长素材
  • 对网站建设心得连接友谊
  • 批量查询网站是否正常什么是关键词举例说明
  • 哪个网站可以做装修效果图中国最新消息新闻
  • 国外直播做游戏视频网站有哪些汕头网站建设开发
  • 安阳做网站哪里好百度在线客服问答
  • 做教育业网站外贸网站制作公司
  • java和php开发网站软件推广怎么做
  • 南京农业大学新校区建设网站网络搜索关键词
  • 桂林市区是哪个区北京seo公司有哪些
  • 网站首页的图标是怎么做的系统设置友情链接有什么作用
  • 网站续费怎么做品牌运营方案
  • 静态网站 后台小说风云榜
  • 设计公司十大品牌网站seo诊断工具
  • 后台网站地图管理微信软件
  • 网络营销渠道的功能有杭州优化关键词
  • 顺义石家庄网站建设汕头百度网站推广
  • 视频网站做漫画网站自动收录
  • 网站建设维护是干什么西安官网seo技术
  • 汉沽集团网站建设太原关键词排名提升
  • 昌大建设滨州项目网站性能优化方法
  • 湖南常德市网站seo搜索引擎优化怎么做
  • 快速建网站软件微软bing搜索引擎
  • 建设交友网站的目的百度软件下载
  • 做网站什么内容二级不死域名购买
  • 什么网站模板网址大全qq浏览器
  • 党建联盟网站建设通知盘多多网盘搜索
  • 图书馆主题 wordpress橘子seo
  • 烟台网站建设工资百度竞价是什么
  • 云南做商城网站多少钱网站搜索排名优化软件