r96 vs r97
11
[[분류:냥]][Include(틀:상세 내용, 설명대상=원본, 문서명=틀\:계산기)]
22
== 2-2 ==
33
===# 디버그 #===
4
{{{#!if a= ,b= ,f=
4
{{{#!if a="111.111" ,this.b="111.111" ,f="+"
55
}}}
66
{{{#!wiki style="display: none; display: inline;"
77
##초기화
......
1818
}}}{{{#!if this.al=as.length, this.bl=bs.length, this.ad=as.indexOf("."), this.bd=bs.indexOf(".")
1919
}}}{{{#!if ad!=-1
2020
소수점이 발견되는 자리 번호가 ad이므로 ad+1번에 해당되는 자리부터 끝까지 표기.
21
{{{#!if this.au=as.substr(0,ad), this.ab=as.substr(ad+1, al-ad-1), this.ap=ab.length
21
{{{#!if this.au=as.substr(0, ad), this.ab=as.substr(ad+1, al-ad-1), this.ap=ab.length
2222
}}}{{{#!if (au=="")||(au=="-")||(au=="+")
2323
.12345 식으로 또는 -.12345 식으로 기입할 경우 upper 값을 0으로 부여함.
2424
{{{#!if au="0"
2525
}}}}}}}}}{{{#!if ad==-1
2626
{{{#!if this.au=as, ab="", ap=0+0
2727
}}}}}}{{{#!if bd!=-1
28
{{{#!if this.bu=bs.substr.(0,bd), this.bb=bs.substr(bd+1, bl-bd-1), this.bp=bb.length
28
{{{#!if this.bu=bs.substr.(0, bd), this.bb=bs.substr(bd+1, bl-bd-1), this.bp=bb.length
2929
}}}{{{#!if (bu=="")||(bu=="-")||(bu=="+")
3030
{{{#!if bu="0"
3131
}}}}}}}}}{{{#!if bd==-1
......
6565
{{{#!if f=="-"
6666
{{{#!if ru=(+au)-(+bu)
6767
}}}}}}
68
68
{{{#!if +au==111
69
+au==111}}}
70
{{{#!if +bu==111
71
+bu==111}}}
72
{{{#!if +ru==222
73
+ru==222}}}
6974
a와 b 모두가 정수이면 ad=a.indexOf("."), bd=b.indexOf(".") 모두 -1이고 ap==0, bp==0이 되며, 이런 경우에는 소수점 아래 자릿수를 검산할 필요가 없습니다. a와 b 중 소수점 아래 자릿수가 있는 수가 있을 때에만 소수점 윗자리의 계산값이 얼마가 나오느냐를 보면서 소수점 아래의 자릿수를 정리하는 과정이 의미가 있습니다.
7075
{{{#!if (ap>0)||(bp>0)
7176
만약 소수점 아래를 계산한다면 자릿수를 똑같이 맞춰야 의미가 있으므로, 자릿수가 다른 경우 자릿수가 같게 만드는 과정을 먼저 거칩니다.
......