The NoteBook of EricKong

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            611 Posts :: 1 Stories :: 190 Comments :: 0 Trackbacks

          When you use PIC 9V9, COBOL assumes a decimal-point, and treats the number as a real(fractional) number with Integer-part before the decimal-pt and Fractional-part after the decimal-pt in all Arithmetic-Operations. 

          When you use PIC 9.9, COBOL does not treat it like a Real(Decimal) Number. The decimal-Point is merely used for display-formatting purposes, the '.' character is simply force-inserted in between the 2-digits. It does not tell COBOL to treat the number as Decimal-number.

          Image244

          In the above code, COBOL treats WS-A as 2.3, but WS-B as 23, in all
          arithmetic-Operations. When WS-A is displayed on the screen, it shows up as 23. WS-B shows up as 2.3, as you have forced a '.' symbol to be display between 2 and 3.

          Image245

          Also note that, WS-A occupies just 2-bytes of Storage space. WS-B on the other hand occupies 3-bytes of storage space, as you have force-inserted the decimal-point '.' character(which occupies 1 byte).

          posted on 2011-12-27 10:18 Eric_jiang 閱讀(192) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 河池市| 福泉市| 嫩江县| 手游| 江达县| 南川市| 景德镇市| 惠东县| 富川| 渝中区| 辽宁省| 南乐县| 开远市| 喜德县| 天津市| 隆林| 平罗县| 呼图壁县| 天祝| 临沧市| 黎川县| 泰来县| 古交市| 呼图壁县| 镇平县| 丹阳市| 台北县| 枝江市| 杭锦旗| 清镇市| 饶阳县| 开平市| 静乐县| 从江县| 土默特左旗| 洛隆县| 平谷区| 汽车| 兴隆县| 长沙县| 洪雅县|