'''Floating-Point''' Arithmetic abbr. '''FP''' '''floating point number''' abbr. '''FPN''' 구성 * [[부호,sign]] indicator * [[지수,exponent]] - curr. see [[지수,exponentiation]] * [[가수,mantissa]] - tmp: https://everything2.com/title/mantissa https://foldoc.org/mantissa 거의 모두 IEEE 754를 따르는 듯. https://pub.mearie.org/ieee_754 [[WpEn:IEEE_754]] [[Wiki:IeeeSevenFiftyFour]] https://oeis.org/wiki/IEEE_arithmetic * fp16 half precision * fp32 single precision * fp64 double precision // WpEn:Double-precision_floating-point_format * fp80 extended precision, etc. // WpEn:Extended_precision // double-extended라고도 하는 듯? 여기서 * single precision floating point - 단정도 (''정도는 정밀도를 줄인 말인가?'') * double precision floating point - 배정도 기타 이런 게 있다. precision을 어떻게 할 것인가, 비트를 어떻게 분배할 것인가, 정확도(정밀도?)와 범위를 어떻게 절충할 것인가, 이런 문제? CHK * Google BFloat16 (exponent범위가 fp16보다 넓다) * NVIDIA TensorFloat * Automatic mixed precision (AMP) * Microsoft Binary Format (MBF) - historic * Minifloat see also https://medium.com/@moocaholic/fp64-fp32-fp16-bfloat16-tf32-and-other-members-of-the-zoo-a1ca7897d407 ## 황종선 손진곤 { 소수점 밑 첫째 자리가 0이 아닌 수가 나오도록 하는 것이 저장에 효율적 - [[정규화,normalization]] ## } 계산하는 장치는 FPU. floating_point_unit / floating-point_unit { '''floating point unit, FPU, 부동소수점장치''' Compare: ALU 산술논리장치 arithmetic_logic_unit [[WpKo:산술_논리_장치]] [[WpEn:Arithmetic_logic_unit]] Links: https://wiki.osdev.org/FPU X86 FPU 관련 자료 Twins: [[WpKo:부동소수점_장치]] } 연산 결과가 항상 참값이 아니며 [[근사,approximation]]값일 수 있음. 대개의 경우? CHK. 약간의 [[오차,error]]가 있을 때가 많음. ex. 0.1 + 0.2 = 0.30000000000000004 https://0.30000000000000004.com/ (PL별 결과) via: https://johngrib.github.io/blog/2017/08/23/0.30000000000000004/ 따라서 [[비교,comparison]] 연산에 주의를 기울여야 한다, 특히 등호를 쓰는 ... (상등? 동등? equality? equivalence? equality_operator or equality_operation? rel: [[동치관계,equivalence_relation]]? equals? 아무튼 C/C++ 유래 PL 문법에서 `==` and `!=` 를 쓰는 그 연산) 을 할 때. 관련links tmp { https://everything2.com/title/floating-point+comparison 아주 약간의 [[오차,error]] ([[machine_epsilon]]를 사용? - 작성중) 를 무시하는 식으로 - 약간의 차이가 있어도 같다고 - 해야 함. } 그리고 마찬가지 이유로 오차의 전파? error_propagation? ([[uncertainty_propagation]] 작성중) - 에도 주의해야. 그리고 related links [[Wiki:FloatingPointFractions]] = 32bit float = single precision 1bit 부호, 0 양수 1 음수 8bit 지수부 나머지 가수부 = 64bit float = double precision 1bit 부호 11bit 지수 52bit 가수 = 부동소수점 산술 = 분리?? [[부동소수점산술,floating_point_arithmetic]] { https://mathworld.wolfram.com/Floating-PointArithmetic.html Up: [[산술,arithmetic]] } = floating point unit, FPU = 이걸 처리하는 장치, 대체로 CPU 내에 통합되어 있는 https://foldoc.org/Floating-Point+Unit [[WpKo:부동소수점_장치]] [[WpEn:Floating-point_unit]] = seealso = [[Not_a_number,NaN]] [[수치해석,numerical_analysis]] [[유리수,rational_number]] [[점,point]] = 자바 책에서 = ||float ||approximately 10^^-38^^ to 10^^38^^ ||7 significant digits || ||double||approximately 10^^-308^^ to 10^^308^^ ||15 significant digits || = Ref. = http://csillustrated.berkeley.edu/illustrations.php See: Floating Point Number http://mathworld.wolfram.com/Floating-PointArithmetic.html http://mathworld.wolfram.com/Floating-PointAlgebra.html http://mathworld.wolfram.com/Floating-PointNumber.html Google:floating+point+arithmetic https://www.secmem.org/blog/2020/05/15/float/ https://wiki.osdev.org/Floating_Point_Number Half-Precision Floating-Point, Visualized https://observablehq.com/@rreusser/half-precision-floating-point-visualized 설명하는 그림/그래프는 마우스 휠로 줌 인/아웃 가능. = Links en = https://randomascii.wordpress.com/category/floating-point/ = PL별 syntax: FP literal = http://rosettacode.org/wiki/Literals/Floating_point [[리터럴,literal]] ---- Compare: 그냥 [[정수,integer]], esp. 컴퓨터의 integer [[고정소수점,fixed_point]]; curr goto p FixedPoint [[WpEn:Arbitrary-precision_arithmetic]] ([[bignum]]) { '''arbitrary-precision arithmetic, bignum arithmetic, multiple-precision arithmetic, infinite-precision arithmetic''' (wpen) compare [[bigint]]. [[Wiki:BigNum]] } ---- Twins: https://foldoc.org/floating-point https://mathworld.wolfram.com/Floating-PointRepresentation.html https://mathworld.wolfram.com/Floating-PointAlgebra.html https://mathworld.wolfram.com/Floating-PointNumber.html https://everything2.com/title/Floating+point https://everything2.com/title/Floating+point+multiplication https://everything2.com/title/Floating+point+operation https://everything2.com/title/IEEE+754 https://hut.mearie.org/floating-point/ WpKo:부동소수점