r74 vs r75
......
1010
'''ab''' : "a" below value (string→integer); '''bb''' : "b" below value (string→integer);
1111
'''ap''' : "a" # of places of decimal (integer); '''bp''' : "b" # of places of decimal (integer);
1212
0.303과 0.0303은 다른 수이므로 자리수가 다름을 표시할 용도
13
'''ru''' : "result" upper value (integer); '''rb''' : "result" below value (integer); '''rp''' : "result" # of places of decimal (integer)
13
'''ru''' : "result" upper value (integer→string); '''rb''' : "result" below value (integer→string); '''rp''' : "result" # of places of decimal (integer)
1414
{{{#!if this.as=a.toString(), this.bs=b.toString(), this.ru=0+0, this.rb=0+0
1515
}}}{{{#!if this.al=as.length, this.bl=bs.length, this.ad=as.indexOf("."), this.bd=bs.indexOf(".")
1616
}}}{{{#!if ad!=-1
......
141141
}}}}}}
142142
}}}
143143
144
a가 음수인 경우 소수점 아래 값은 순 숫자만 표기된 상태이 양수 취급으로 되지 않도록 음수 표기를 해야 합니다.
144
a가 음수인 경우 소수점 아래 값은 순 숫자만 표기된 상태이므로 양수 취급으로 되지 않 소수점 아래 값에 음수 표기를 남깁니다.
145145
{{{#!if as[0]==45
146146
{{{#!if ab="-"+ab
147147
}}}}}}
......
163163
문자열 길이를 rp로 정의합니다.
164164
{{{#!if this.rp=rb.length
165165
}}}
166
rb가 음수이면 마이너스 부분을 잘라내어 저장시키고 rp를 다시 정의합니다.
166
rb가 음수이면 rp를 -1로 줄여 정의합니다.
167167
{{{#!if rb[0]==45
168
{{{#!if rb=rb.substr(1, rp-1)
169
}}}{{{#!if rp=rb.length
168
{{{#!if rp=rp-1
170169
}}}}}}
171170
172
171
ru는 정수이므로 ru가 0보다 크면 곧 1 이상이며, 1 이상이면 양수+음수 꼴이 되더라도 소수점 아래 정리를 하면 됩니다. ru에서 1을 빌려오거나 ru에 1이 더해질 수도 있습니다.
173172
{{{#!if ru>0
174
ru는 정수이므로 0보다 크면 곧 1 이상이며, 1 이상이면 양수+음수 꼴이 되더라도 소수점 아래 정리를 하면 됩니다. ru에서 1을 빌려오거나 ru에 1이 더해질 수도 있습니다.
175173
{{{#!if rb>0
176174
}}}}}}
177175
{{{#!if ru==0
......