ICT
the blog for ICT
ken013194
暱稱: ホロ
性別: 男
國家: 香港
地區: 葵青區
« March 2015 »
SMTWTFS
1234567
891011121314
15161718192021
22232425262728
293031
最新文章
Text File
Arrays
String Procedures
String Functions
String Operation
文章分類
全部 (23)
Programming Language (23)
訪客留言
最近三個月尚無任何留言
每月文章
日誌訂閱
尚未訂閱任何日誌
好友名單
尚無任何好友
網站連結
尚無任何連結
最近訪客
最近沒有訪客
日誌統計
文章總數: 23
留言總數: 0
今日人氣: 1
累積人氣: 76
站內搜尋
RSS 訂閱
RSS Feed
2009 年 9 月 11 日  星期五   晴天


Arithmetic Exp 分類: Programming Language

High-level Programming Language (Pascal)

Arithmetic Expressions in Pascal

  • similar to the mathematical expressions
  • an expression can be a constant, a variable or a combination of constants, variables and operators
  • a list of mathematical operators and Pascal operators is shown below :

    Mathematical Operator
    Pascal Operator
    Operation
    Example
    Result
    +
    +
    Addition
    3+2
    5
    -
    -
    Subtraction
    3-2
    1
    -
    -
    Unary Minus
    -3
    -3
    ×
    *
    Multiplication
    3*2
    6
    ÷
    /
    Real Division
    5/2
    2.5
    ÷
    div
    Integer Division
    5 div 2
    2
    mod
    mod
    Modulo (remainder)
    5 mod 2
    1

  • the order of precedence

    Level of Precedence
    Arithmetic Operator
    highest
    ( )
    high
    - (unary minus)
    low
    *, /, mod, div
    lowest
    +, - (subtraction)

 






訪客留言 (返回 ken013194 的日誌)

訪客名稱:
電郵地址: (不會公開)
驗證碼:  按此更新驗證碼 (如看不清楚驗證碼請點擊圖片刷新)
俏俏話: (必需 登入 後才能使用此功能)
[ 開啟多功能編輯器 ]