Floating-Point Arithmetic
abbr. FP
floating point number abbr. FPN
}
32bit float ¶
single precision
1bit 부호, 0 양수 1 음수
8bit 지수부
나머지 가수부
64bit float ¶
double precision
1bit 부호
11bit 지수
52bit 가수
floating point unit, FPU ¶
이걸 처리하는 장치, 옛날에는 CPU 밖에
코프로세서,coprocessor로 별도로 있었고, 현재는 대체로 CPU 내에 통합되어 있는
GPGPU를 한다면 GPU에도 대량으로 존재하는 것을 이제 ML등 여러 용도로 많이 쓰는....
자바 책에서 ¶
float | approximately 10-38 to 1038 | 7 significant digits |
double | approximately 10-308 to 10308 | 15 significant digits |
PL별 syntax: FP literal ¶
Compare:
{
floating point number/arithmetic(curr.
부동소수점,floating_point)과 비교하여 장단점
- less flexible (당연히, 고정되어 있으므로) → 표현 가능 수 범위가 좁은.
- ...또 뭐있지? 구현하기 간단한 거?
비트 배분 :
부호,sign,
fixed point : 부호 1 bit + 나머지 integer part - 두 부분으로 이루어짐. (소수점의 위치는 어딘가로
fixed)
floating point : 부호 1 bit + 유효숫자?를 나타내는 가수부(mantissa) + 소수점의 위치를 나타내는 지수부 - 세 부분으로 이루어짐.
비트 배열 순서는 보통 부호 | 지수부 | 가수부 순.
(cf. 보통 사람이 쓰는 표기 순서는 보통 부호 | 가수부 | 지수부 순.)
}
{
arbitrary-precision arithmetic, bignum arithmetic, multiple-precision arithmetic, infinite-precision arithmetic (wpen)