Subnormal number
In computer science, subnormal numbers are the subset of denormalized numbers (sometimes called denormals) that fill the underflow gap around zero in floating-point arithmetic.[src] Any non-zero number with magnitude smaller than the smallest positive normal number is subnormal, while denormal can also refer to numbers outside that range.[src]
In computer science, subnormal numbers are the subset of denormalized numbers (sometimes called denormals) that fill the underflow gap around zero in floating-point arithmetic.[src] Any non-zero number with magnitude smaller than the smallest positive normal number is subnormal, while denormal can also refer to numbers outside that range.[src] include pragma STDC FENV_ACCESS ON // Sets DAZ and FTZ, clobbering other CSR settings.[src] fesetenv(FE_DFL_DISABLE_SSE_DENORMS_ENV); // fesetenv(FE_DFL_ENV) // Disable both, clobbering other CSR settings.[src] For other x86-SSE platforms where the C library has not yet implemented this flag, the following may work: include _mm_setcsr(_mm_getcsr() | 0x0040); // DAZ _mm_setcsr(_mm_getcsr() | 0x8000); // FTZ _mm_setcsr(_mm_getcsr() | 0x8040); // Both _mm_setcsr(_mm_getcsr() & ~0x8040); // Disable both The and macros wrap a more readable interface for the code above.[src] // To enable DAZ include _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); // To enable FTZ include _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); Most compilers will already provide the previous macro by default, otherwise the following code snippet can be used (the definition for FTZ is analogous): define _MM_DENORMALS_ZERO_MASK 0x0040 define _MM_DENORMALS_ZERO_ON 0x0040 define _MM_DENORMALS_ZERO_OFF 0x0000 define _MM_SET_DENORMALS_ZERO_MODE(mode) _mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (mode)) define _MM_GET_DENORMALS_ZERO_MODE() (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK) The default denormalization behavior is mandated by the ABI, and therefore well-behaved software should save and restore the denormalization mode before returning to the caller or calling code in other libraries.[src] if defined(__arm64__) || defined(__aarch64__) uint64_t fpcr; asm( "mrs %0, fpcr" : "=r"( fpcr )); //Load the FPCR register asm( "msr fpcr, %0" :: "r"( fpcr | (1 Some ARM processors have hardware handling of subnormals.[src]
9 sentences · 9 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Subnormal number." encyclopegia.org, 2026, https://encyclopegia.org/wiki/subnormal-number. Accessed 26 November 2026.
Chicago
"Subnormal number." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/subnormal-number.
APA
encyclopegia.org. (2026). Subnormal number. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/subnormal-number
Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON