- 1、本文档共7页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
ArithmeticOperationinPascalPascal的算术运用.doc
PASCAL
Chapter 3: Arithmetic Operation in PASCAL
第三課:PASCAL的算術運算
3.1 Arithmetic Operation算術運算
Mathematical Operation
數學運算 PASCAL Operator
PASCAL 運算符 Operation
運算 Example
例子 + + Addition 加法 5 + 12
1.2 + 3.4 - - Subtraction 減法 4 – 2
3.2 – 2.1 - - Unary Minus 一元減法 -4
-8.8 ( * multiplication 乘法 4 * 8
7.2 * 1.2 ( / Real Division
實 數 除 法 4 / 2
4.5 / 1.5 ( Div Integer Division
整 數 除 法 23 div 3 mod Mod Modulo ( Reminder )
模數 ( 餘 數 ) 23 mod 3
The operators can be use in numbers, constants and variables.以上的運算符可以用於數字、常量及變量。
In an operation, it can have both integer type and real type variables:在運算過程中,可以同時包括整數及實數類:
If in a operation have both integer and real data types, the output value must be ( real ) type.如果在一個算術運算中包括整數和實數類,其輸出結果一定是( 實 數 )類。
If the operation involved / (real division), the output value must be real type.如果在運算式中掀涉「 / 」(實數除法),其輸出結果一定是實數。
Operation
運算 Example
例子 Result
結果 Result Type (I: Integer 整數)
結果類型 (R: Real Type 實數) + Addition加法 123 + 321 444 I 4.4 + 5.5 9.9 R - Subtraction 減法 369 – 123 246 I 0.5 – 0.145 0.355 R ( Multiplication乘法 11 * 5 55 I 2.4 * 0.5 1.2 R ( Real Division實數除法 600 / 20 30.0 R 600.0 / 2.0 30.0 R
3.1.1 Unary Minus一元減法
It is a sign to negate the value of an operand. For example,
這是一個將數值改為其相反數值的符號。例如:
1234 ( ( -1234 )
3.1.2 Integer Division 整數除法
The operand ‘ div ’ to find the ( quotient ) of am integer division. The reminder will be neglected.
其運算符是「 div 」 3 ( Quotient 商
7 ) 25
21
4 ( Reminder 餘數 3
Expression 表達式 Result結果 5 div 8 0 8 div 5 1 8 div –5 -1 -8 div 5 -1 -8 div –5 1 8 div 0 Undefined 8.5 div 5 Undefined
3.1.3 Modulo Operation 模數(餘數)運算
The operator ‘ mod ‘is used to find the ( reminder ) in an integer division and the quotient will be neglected.運算元「 mod 」用作找出整數除的( 餘 數 ),並捨其商。
This operation only allowed for ( integer ) and the divisor must not be ( zero ).此運算只可容許( 整 數 ),而且除數不可以是( 零 )。
Expression 表達式 Result結果 5 mod 8 5 8 mod 5 3 8 mod –5 3 -8 mod 5 -3 -8 mod –5
您可能关注的文档
- 2015-2016年度下学期考试中四级考试范围及温习资料.PDF
- 2015—2016学年第一学期新优质初中创建工程-南京市教学研究室.ppt
- 2015工业工程专业本科培养计划UndergraduateProgramsforthe.PDF
- 2015年8月深圳市气候影响评价分析陈申鹏签发江崟深圳市气候中心.doc
- 2015年全国中等职业学校工科类专业创新杯教师信息化教学设计和.doc
- 2015年网络搭建与应用国赛样题.doc
- 2015年高考真题——理科数学(福建卷)Word版含解析.doc
- 2016-2021年全球卫生部门艾滋病毒战略草案引言和背景.PDF
- 2016-6-27一个基于精算分析的弹性退休方案一个基于精算分析的弹性.PDF
- 2016国考数学运算练习册-小麦公考.PDF
文档评论(0)