Fact-checked by Grok 2 weeks ago

long double

In the C and C++ programming languages, long double is a floating-point intended to provide at least as much precision and range as the standard double type, and often greater precision for more accurate numerical computations in applications such as scientific simulations and . In many implementations, particularly on non-x86 architectures, long double is equivalent to double. The ISO (ISO/IEC 9899:2011) mandates that long double offers at least as much precision as double, which in turn matches or exceeds that of float, but its exact size, , and behavior remain implementation-defined to accommodate diverse hardware architectures. This flexibility allows long double to map to various underlying representations, without strict adherence to a single like binary64 for double. Common implementations include the 80-bit extended precision format on x86 and processors, featuring a 1-bit sign, 15-bit exponent, and 64-bit (with an explicit leading bit), which supports a range from approximately ±3.4 × 10⁻⁴⁹³² to ±1.19 × 10⁴⁹³² and up to 18–19 decimal digits of precision. On some platforms, long double uses a 128-bit quadruple-precision format aligned with binary128, offering even greater precision with a 113-bit and a range up to ±1.19 × 10⁴⁹³², though this may deviate from full compliance in specific operations. In practice, long double supports the same arithmetic operations as other floating-point types, including addition, multiplication, and transcendental functions via libraries like <math.h>, with conversions to and from or performed according to implementation rules for and . Its use is particularly valuable in scenarios demanding minimal rounding errors, but portability challenges arise due to varying representations across compilers and systems, often necessitating conditional compilation or standardized interchange formats.

Definition and Standards

In C and C++

In the C programming language, as standardized in ISO/IEC 9899:2024 (C23), building on earlier versions such as C99 (ISO/IEC 9899:1999), long double is a real floating-point type that provides extended precision and range beyond double. It is declared using the keyword long double, as in long double x;, and supports floating-point literals suffixed with L or l (case-insensitive), such as 3.14L or 1.0l, which denote constants of this type rather than double. For input/output operations, the format specifier %Lf is used with functions like printf and scanf to handle long double values, ensuring correct printing or scanning of extended-precision numbers. Semantically, C23 guarantees that long double is at least as wide as double, meaning it encompasses all values representable by double with potentially greater precision and range, though the exact characteristics are implementation-defined. The <float.h> header defines macros to query these properties, including LDBL_MANT_DIG for the number of bits in the mantissa, LDBL_EPSILON for the difference between 1.0 and the next representable value, LDBL_MIN for the smallest normalized positive value, and LDBL_MAX for the largest finite value. In arithmetic operations, long double participates in the usual arithmetic conversions (also known as the usual floating-point conversions), where it holds the highest rank among floating-point types. If one operand is long double, the other floating-point operand (whether float or double) is converted to long double before the operation, preserving precision and avoiding unnecessary loss. Integer operands may first undergo integer promotions before further conversion to long double if needed, ensuring the result type matches the highest-ranked operand. The inherits these semantics for long double from , as specified in standards like (ISO/IEC 14882:2024), consistent with earlier versions such as (ISO/IEC 14882:2011), where it remains an extended-precision floating-point type with the same declaration syntax, literal suffixes, and format specifiers. The <cfloat> header provides equivalent macros (prefixed LDBL_), and promotion rules align with C's usual arithmetic conversions, integrated into C++'s expression evaluation model for compatibility. In the standard, long double corresponds to an optional format, specifically the double extended format, which provides greater precision and range than the basic double precision (binary64). This format requires at least 79 bits in total, including at least 15 bits for the biased exponent and 64 bits for the , allowing for a precision of at least 64 bits. The standard defines this as an implementation choice, not a mandatory interchange format, to support higher accuracy in intermediate computations without specifying exact bit layouts beyond minimum parameters. A common realization of the double extended is the 80-bit binary representation, consisting of 1 , 15 exponent bits (biased by 16383), and 64 bits (with an explicit leading bit, yielding 64 bits of including the bit). In contrast, the introduces binary128 as a quadruple interchange , featuring 1 , 15 exponent bits (biased by 16383), and 112 fraction bits (providing 113 bits of with the implicit leading bit). This 128-bit offers significantly expanded range and compared to the 80-bit extended , with an exponent range from -16382 to +16383 and support for subnormal numbers. Arithmetic operations in , such as , , , and , are performed by first computing results to and then to the destination format, which must be at least as wide as the wider . The standards specify five modes—round to nearest (ties to even), round toward positive , round toward negative , round toward zero, and (in 2008) round ties to away from zero—for controlling these operations, with round to nearest as the default. Exceptions include invalid operation (e.g., signaling NaN propagation or minus ), (yielding ), (resulting in or the maximum finite value), underflow (gradual via subnormals), and inexact (when occurs), all of which must be signaled appropriately in extended formats. The ISO/IEC 60559 standard, which adopts as its basis, permits but does not mandate extended precision formats like those used for long double, ensuring compatibility with basic binary32 and binary64 while allowing implementations to extend precision for improved . This relationship underscores the optional nature of long double in standardized , focusing on interchangeability for basic formats while supporting extended ones for specialized applications.

Historical Development

Origins in Early C

The concept of extended floating-point precision in early C emerged as an extension to address the limitations of single-precision floats on hardware like the PDP-11 and VAX systems, where 32-bit floats were insufficient for numerical computations requiring greater accuracy. In the 1978 K&R specification, "long float" was introduced as a type synonymous with double, providing 64-bit precision to mitigate rounding errors in scientific simulations and engineering calculations, drawing inspiration from VAX hardware formats such as the 64-bit D_floating and G_floating datatypes that offered expanded range over the PDP-11's basic floating-point unit. Early UNIX C compilers developed at initially implemented long float (and later long double) as an alias for on PDP-11 systems, reflecting the era's hardware constraints and the need for portable higher-precision in system and application development. By the early , as VAX systems gained prominence, compilers supported floating-point types aligned with VAX formats, but long double in standard VAX C implementations remained equivalent to double, using 64-bit D_floating or G_floating formats, with variations across specific extensions. These developments were driven by the growing demands of scientific computing at Bell Labs and UNIX users, where reduced rounding errors were essential for simulations in physics and engineering, prompting discussions within the nascent standardization efforts. In 1983, the X3J11 committee, formed by ANSI to formalize C, debated precision requirements for floating-point types, recognizing the value of an extensible long double to accommodate diverse hardware like VAX while ensuring portability beyond the pre-standard extensions.

Evolution Across Language Standards

The standard, ratified as ANSI X3.159-1989 and later adopted internationally as ISO/IEC 9899:, introduced long double as a standard floating-point type for beyond , requiring at least 10 decimal digits of precision as defined in <float.h> via the LDBL_DIG macro. This formalization ensured portability by mandating that long double provide no less range or precision than double, while allowing implementations to extend it further for higher accuracy in numerical computations. The C99 standard (ISO/IEC 9899:1999) expanded support for long double by mandating the <tgmath.h> header for type-generic mathematical functions, which automatically select the appropriate variant based on argument types, including long double-specific overloads such as sinl() and cosl() for trigonometric operations. These additions promoted generic programming while preserving precision for extended types, with long double retaining its minimum 10 decimal digits but enabling implementations to leverage hardware extended formats where available. Subsequent revisions in (ISO/IEC 9899:2011) and (ISO/IEC 9899:2018) provided minor clarifications to Annex F on IEC 60559 () conformance, specifying that long double must support infinities and NaNs even if not strictly IEC 60559-compliant, and refining type width requirements without altering core precision guarantees. These updates addressed interoperability issues in , ensuring consistent behavior across conforming implementations. In C++, long double was inherited directly from C in the ISO/IEC 14882:1998 (C++98) standard, incorporating the same precision and range semantics with overloads in for functions like sinl(). The C++11 standard (ISO/IEC 14882:2011) introduced constexpr for compile-time evaluation, enabling limited use with floating-point types including long double in constant expressions, alongside refined overloads for better template integration. Later, (ISO/IEC 14882:2020) and enhanced floating-point support through features like std::bit_cast for and additional constexpr mathematical functions applicable to long double, without major changes to its definition but improving precision handling in generic code via WG21 discussions on extended types.

Implementations Across Platforms

x86 and x86-64

On and architectures, the long double type is implemented using the (), which provides format. Introduced with the coprocessor in the 1980s, the FPU features eight 80-bit registers labeled ST0 through ST7, organized as a . Each register holds a value in the extended precision format consisting of 1 , a 15-bit biased exponent (with 16383), and a 64-bit including an explicit bit set to 1 for normalized numbers. In memory, long double values are stored in a packed 80-bit (10-byte) format to match the x87 register layout, but for compatibility with SSE and AVX instructions requiring 16-byte alignment, implementations often pad the type to 128 bits (16 bytes) with unused bytes set to zero. This padding ensures efficient vector operations without misalignment penalties, though the effective precision remains 80 bits. On , compiler implementations vary: and default to the 80-bit for long double, aligning it to 16 bytes per the System V AMD64 ABI. In contrast, Microsoft Visual C++ (MSVC) maps long double to the 64-bit type for both storage and computation. LLVM-based provides the -mno-80-bit-float option to disable 80-bit and enforce 64-bit semantics, aiding portability. The System V AMD64 ABI, used on and other systems, reserves 16 bytes on the stack and in parameter passing for long double, treating it as two consecutive 64-bit values for SSE register transfer when possible. On Windows x64, the ABI allocates only 8 bytes, aligning with MSVC's 64-bit implementation and passing values via XMM registers as doubles. With the introduction of extensions, x86 processors support double-precision (64-bit) floating-point operations through instructions like VADDPD and VMULPD on ZMM registers, but the long double type continues to use the legacy 80-bit format without native for beyond double.

ARM and Other Architectures

On architectures, particularly in the execution state, long double is implemented as a 128-bit quadruple-precision floating-point type conforming to the binary128 format, which includes 1 , 15 exponent bits, and 112 bits for enhanced and . This hardware support enables efficient computation of high-precision operations, though library functions may involve software for certain transcendental functions. In contrast, on older 32-bit ARMv7 implementations, such as those using soft-float libraries, long double is typically implemented as the same 64-bit double-precision type due to the absence of native extended-precision hardware. For PowerPC and , long double is typically realized as a 128-bit type using the format, which combines two adjacent 64-bit double-precision values to approximate quadruple precision through arithmetic operations on the high- and low-order parts. This emulated approach provides effective without requiring dedicated hardware on earlier processors like POWER7 and POWER8. However, starting with the architecture, native hardware support for 128-bit quadruple-precision operations is available, allowing direct execution of binary128 instructions for improved performance in numerical applications. On and architectures, long double is standardized as a 128-bit quadruple-precision type aligned with binary128, enabling compilers like to generate code for high-precision floating-point computations as the default configuration. For these RISC platforms, supports explicit control via options such as -mlong-double-128 to ensure the 128-bit format, particularly useful in environments requiring consistent across builds. The architecture defaults to a 128-bit long double in compiler implementations like , mapping it to the binary128 format for scalar operations. Additionally, the RISC-V Vector Extension (RVV) provides support for floating-point operations up to double precision in vectorized contexts, enabling scalable parallel numerical workloads. In embedded systems, such as those based on cores, long double is frequently implemented as a for (64-bit binary64) due to hardware constraints that prioritize memory efficiency and lack native support for extended formats. This choice reflects the resource-limited nature of these microcontrollers, where software of higher precision would impose significant performance overheads without corresponding .

Usage and Practical Considerations

Precision, Range, and Performance

Long double offers extended precision beyond the standard type, typically providing 18 to 34 digits depending on the underlying . The 80-bit extended precision format, common in x86 implementations, delivers approximately 19 digits through its 64-bit (including the explicit leading bit). In contrast, 128-bit quadruple precision formats like binary128 achieve around 34 digits with a 113-bit . This additional precision is crucial for computations requiring fine-grained numerical distinction, though it comes at the cost of increased storage and computational overhead. The representable range of long double far exceeds that of , with decimal exponents spanning roughly -4932 to +4932 for normalized values in both 80-bit and 128-bit formats, enabled by a 15-bit exponent with a of 16383. The minimum normalized positive value is given by $2^{e_{\min}}, where e_{\min} = -16382, while subnormal values extend further downward to $2^{e_{\min} - (p - 1)}, with p denoting the (64 for 80-bit explicit , 113 for 128-bit). This provides an expansive range supporting extreme scales in scientific modeling without or underflow in most scenarios; for example, the smallest subnormal in 80-bit is approximately 3.36 × 10^{-4951}, and in binary128 approximately 1.08 × 10^{-4966}. Performance-wise, long double incurs notable trade-offs on contemporary hardware, with x87-based 80-bit operations showing similar latencies to double (3-6 cycles) but lower throughput (typically 1 operation per cycle scalar) compared to optimized SSE or AVX instructions for double, which support vectorization up to 16 operations per cycle in AVX-512. These inefficiencies, stemming from the lack of native vector support for extended formats and legacy x87 dependence, make long double suitable only where precision outweighs speed, especially as modern compilers default to SSE/AVX on x86-64, emulating x87 if needed. On modern x86-64 systems, compilers like GCC and Clang default to SSE2/AVX for floating-point, treating long double as 80-bit but emulating via software if needed, further impacting performance unless x87 is explicitly enabled. In practice, long double shines in domains demanding high fidelity, such as simulations, where it mitigates error propagation in long-term orbital integrations. By reducing rounding error accumulation in iterative algorithms—where each step's residual can amplify discrepancies over thousands of iterations—long double preserves accuracy that might lose, though apply for general-purpose applications beyond such specialized needs.
FormatDecimal DigitsBinary Exponent RangeDecimal Exponent Range
80-bit extended~19-16382 to 16383-4932 to 4932
128-bit quadruple~34-16382 to 16383-4932 to 4932

Portability and Compatibility Issues

The size of long double varies across platforms and compilers, leading to challenges in writing portable code that assumes a consistent layout or storage. On x86 architectures with GCC, it is typically 12 bytes (96 bits) to accommodate the 80-bit extended precision format, while on x86-64 it may be 16 bytes depending on ABI settings. On ARM architectures, it is often 8 bytes (equivalent to double), though some configurations support 16 bytes for 128-bit quadruple precision. In certain embedded systems, such as those using AVR-GCC, it is also 8 bytes, matching double to conserve resources. To check portability without relying on sizeof(long double), developers can use macros from <float.h> like LDBL_DIG (decimal digits of precision) or LDBL_MANT_DIG (binary mantissa digits), which provide implementation-defined values for conditional logic, such as enabling extended precision only if LDBL_DIG > DBL_DIG. Compiler flags offer control over long double behavior but introduce further variability. In , options like -mlong-double-64 force equivalence to double (8 bytes), -mlong-double-80 enables the x86 extended precision format, and -mlong-double-128 uses 128-bit quadruple precision, altering ABI and structure layouts. provides analogous flags, such as -mlong-double-64 to enforce double equivalence or -mlong-double-128 for extended types, with -mno-long-double-80 specifically disabling the 80-bit format on x86 to promote consistency. These flags are essential for matching behaviors across builds but require explicit specification in build systems like to avoid silent mismatches. Application Binary Interface (ABI) incompatibilities arise when linking code compiled with different tools, particularly on Windows. Microsoft's Visual C++ (MSVC) implements long double identically to double (8 bytes, 64-bit IEEE 754), while GCC via MinGW uses an 80-bit format (padded to 12 or 16 bytes), causing stack misalignment, incorrect argument passing, or linker errors in mixed binaries. Solutions include using #pragma pack to adjust structure padding, compiler intrinsics like __stoulongdouble for type conversions, or avoiding long double in public interfaces by substituting double or fixed-width alternatives. Debugging long double introduces pitfalls due to varying representations of special values like and . On x86 with extensions, NaN payloads and infinity encodings differ from strict formats on or other architectures, potentially causing inconsistent behavior in comparisons or across platforms. For instance, a NaN generated on x86 may not compare equal to itself when ported to without proper handling. Recommendations include conditional compilation directives like #ifdef __x86_64__ to isolate architecture-specific , combined with runtime checks using isnanl or isinfl from <math.h> for robust error detection. Modern trends in C++ address these issues through the introduction of fixed-width floating-point types in the <stdfloat> header, as proposed in LEWG paper , which favors portable aliases like std::float128_t over the implementation-defined long double for high-precision needs. These types ensure consistent bit widths (e.g., 128 bits for quadruple precision) without ABI disruptions, reducing reliance on compiler-specific extensions. Discussions in the C++ committee highlight long double's portability limitations, encouraging its de-emphasis in favor of standardized alternatives for cross-platform numerical code.

Extensions in Other Languages and Systems

In Fortran and Numerical Libraries

In , quadruple precision floating-point arithmetic, equivalent to the extended precision often associated with in other languages, has been supported since the 90 through the intrinsic function, which allows specification of desired and exponent range. For instance, SELECTED_REAL_KIND(p=33, r=4931) selects a kind parameter typically corresponding to 128-bit quadruple precision with at least 33 digits of and an exponent range from approximately 10^{-4931} to 10^{4931}. This approach enables portable declaration of high- reals, such as REAL(KIND=SELECTED_REAL_KIND(33,4931)), often simplifying to REAL(KIND=16) on implementations like gfortran and where kind 16 maps to quadruple precision. Non-standard extensions like REAL*16 provide direct quadruple declarations but are not part of the core . Intrinsic functions in , such as , COS, and EXP, are generic and automatically operate at the precision of their arguments, supporting quadruple precision when invoked with quadruple real inputs. For example, calling on a quadruple real argument yields a quadruple real result, leveraging the compiler's implementation of -compliant operations where available. The ISO Fortran 2008 standard further enhances this by providing bindings to quadruple precision through intrinsic modules like IEEE_ARITHMETIC, which allow control over floating-point modes such as , , and underflow behavior for high-precision computations. This module enables queries and settings for , ensuring conformance to the IEEE 754-2008 standard for quadruple formats on supported platforms. Numerical libraries commonly extend 's high-precision capabilities for specialized tasks. QUADPACK, a for one-dimensional , includes routines adaptable to quadruple precision via kind parameters, with modern implementations providing explicit quadruple interfaces for methods like QNG and QAG. The Scientific Library (GSL), while primarily a , provides long double support in many of its mathematical functions and can be interfaced from , though its integration routines are implemented for double precision; for high-precision integration, like modern QUADPACK extensions or MPFR are preferred. For scenarios exceeding hardware quadruple limits, the MPFR library—providing arbitrary-precision —serves as a fallback, with wrappers like MPFUN enabling seamless integration for operations requiring more than 33 digits of precision. Interoperability between Fortran and C is facilitated by the ISO_C_BINDING module introduced in Fortran 2003 and refined in later standards, allowing direct mixing of Fortran quadruple reals with C's long double types. The named constant C_LONG_DOUBLE specifies a Fortran real kind interoperable with C's long double, typically mapping to quadruple precision on platforms where both support extended formats; for example, a Fortran subroutine can bind a REAL(C_LONG_DOUBLE) argument to a C function expecting long double. This enables hybrid applications, such as using MKL's long double BLAS and routines—which provide optimized quadruple-precision linear algebra operations like (e.g., ?) and eigenvalue solvers—from Fortran code, ensuring high-performance numerical computations across language boundaries.

In Assembly and Low-Level Programming

In x86 assembly programming, long double typically refers to the 80-bit extended-precision format supported by the (FPU). The FLD instruction loads an 80-bit double-extended precision value from a memory operand (m80fp) onto the FPU register stack, decrementing the stack pointer (TOP) by 1 and placing the value in ST(0) without conversion, as the format is native to the registers. Conversely, the FSTP instruction stores the value from ST(0) to a memory location in 80-bit format and pops the stack by incrementing TOP, preserving the full precision during the transfer. These instructions enable direct manipulation of long double values in performance-critical code, such as numerical simulations requiring intermediate . For 128-bit long double implementations on x86, which lack native hardware support and rely on software emulation (often as double-double pairs of 64-bit doubles), and later extensions facilitate efficient memory access through intrinsics. For instance, MSVC provides intrinsics like _mm_load_pd to load packed double-precision values into 128-bit XMM registers, allowing assembly or compiler-generated code to handle the component parts of the emulated format for operations like or . Inline in , using the asm keyword, is commonly employed for x87 FPU operations on long double; for example, to add two 80-bit values while ensuring memory alignment:
c
long double add_long_double(long double a, long double b) {
    long double result;
    __asm__ ("fld %1\n\t"
             "fld %2\n\t"
             "faddp %%st, %%st(1)\n\t"
             "fstp %0"
             : "=m" (result)
             : "m" (a), "m" (b)
             : "st", "st(1)");
    return result;
}
This example loads the operands onto the , performs the addition with pop, and stores the result, with memory operands required to be aligned (typically 16 bytes for emulated 128-bit types to avoid partial writes). On architectures, particularly where long double is defined as 128-bit quadruple precision, and VFP extensions support loading via instructions like VLD1, which can transfer 128-bit data into quad-word registers (Q registers) for software-emulated operations. The VLD1.64 variant loads 64-bit elements (e.g., two doubles) into a quad register, useful for aligned 128-bit floating-point data in vectorized low-level code, though full arithmetic is emulated using paired double-precision instructions. ARM C Language Extensions (ACLE) provide intrinsics such as vld1q_f32 or vld1q_f64 for -based loads, enabling C code to interface with assembly for float128_t types, as in GCC's __float128 support. Low-level programming with long double requires attention to endianness in multi-word formats like double-double, where the representation spans two 64-bit words; in little-endian systems (common on x86 and ARM), the lower-significance word resides at the lower memory address, necessitating byte-order-aware loads to reconstruct the value correctly in assembly or intrinsics. Denormal handling is managed via FPU control registers, such as the x87 control word (FCW), where masking the invalid-operation exception (bit 7) allows denormal operands to be processed without trapping, setting only the denormal flag (DE) in the status word for software detection if needed. In OS kernels and drivers, especially embedded ones, inline assembly accesses custom FPU operations—such as saving/restoring x87 state with FNSAVE/FNRSTOR— to integrate long double computations without disrupting kernel preemption, though direct FPU use is minimized to avoid context-switch overhead.

References

  1. [1]
    P1467R4: Extended floating-point types and standard names
    Jun 12, 2020 · The type double provides at least as much precision as float , and the type long double provides at least as much precision as double .
  2. [2]
    [PDF] Floating-point extensio - Open Standards
    The types float, double, and long double are also called generic floating types for the purpose of. Technical Specification 18661. Note: C does not specify a ...<|separator|>
  3. [3]
  4. [4]
    ISO/IEC/IEEE 60559:2011 - Floating-Point arithmetic
    ISO/IEC/IEEE 60559:2011(E) specifies formats and methods for floating-point arithmetic in computer systems - standard and extended functions.
  5. [5]
    128-bit long double floating-point data type - IBM
    Both values satisfy the definition of epsilon according to standard C. The long double subroutines use the second value because it better characterizes the ...
  6. [6]
  7. [7]
    [PDF] Rationale for International Standard— Programming Languages— C
    ... definition of float and long double libraries; and C99 provides for all three versions of math functions. (acos, asin, atan, atan2, cos, sin, tan, cosh, sinh ...
  8. [8]
    [PDF] IEEE Standard for Binary Floating-Point Arithmetic
    This standard defines four floating-point formats in two groups, basic and extended, each having two widths, single and double. The standard levels of.
  9. [9]
    None
    Summary of each segment:
  10. [10]
    What's the difference between LONG float and double in C++?
    May 31, 2013 · The long float is a K&R C first edition type that existed. It is synonymous with double . After the first standard C89/C90, long float is ...Why did K&R not define data type lengths better? - Stack Overflowlong double (GCC specific) and __float128 - x86 - Stack OverflowMore results from stackoverflow.comMissing: history | Show results with:history
  11. [11]
  12. [12]
    [PDF] A UNIX™ Operating System for the DEC VAX-11/780 Computer*
    The C language programmer will find that int, long, and pointer data types all occupy 4 bytes (a short still occupies 2 bytes), and that a long has its two ...<|control11|><|separator|>
  13. [13]
    [PDF] VAX-11 System Reference Manual - Bitsavers.org
    Feb 19, 1979 · The VAX-11 is a family of upward-compatible computer systems. It is a natural outgrowth of and is heavily compatible with the PDP-11 family. We ...
  14. [14]
    [PDF] for information systems - programming language - C
    The work of X3J11 began in the summer of 1983, based on the several documents that were made available to the Committee (see 1.5, Base. Documents). The ...
  15. [15]
    Evolution of C - catb. Org
    Work on the first official C standard began in 1983 under the auspices of the X3J11 ANSI committee. The major functional additions to the language were ...Missing: double | Show results with:double
  16. [16]
    [PDF] ISO/IEC 9899:yyyy - Open Standards
    Its purpose is to promote portability, reliability, maintainability, and efficient execution of C language programs on a variety of computing systems.
  17. [17]
    [PDF] More constexpr for <cmath> and <complex> - Open Standards
    Jun 15, 2023 · A scattering of constexpr, principally throughout <cmath>, was proposed in [P0533] and accepted into C++23. This was subject to a constraint ...
  18. [18]
    Intel® 64 and IA-32 Architectures Software Developer Manuals
    Oct 29, 2025 · This document describes the bfloat16 floating-point format. 5-Level Paging and 5-Level EPT white paper, This document describes planned ...
  19. [19]
    [PDF] Intel® 64 and IA-32 Architectures Software Developer's Manual
    NOTE: This document contains all four volumes of the Intel 64 and IA-32 Architectures Software. Developer's Manual: Basic Architecture, Order Number 253665; ...
  20. [20]
    x86 Options (Using the GNU Compiler Collection (GCC))
    In the x86-64 compiler, -m128bit-long-double is the default choice as its ABI specifies that long double is aligned on 16-byte boundary. Notice that neither of ...
  21. [21]
    [PDF] System V Application Binary Interface - AMD64 Architecture ...
    Jul 2, 2012 · ... long int or unsigned long int, in that order. 12. AMD64 ABI Draft 0.99.6 – July 2, 2012 – 17:14. Page 14. The long double type uses a 15 bit ...
  22. [22]
    Clang Compiler User's Manual — Clang 22.0.0git documentation
    This document describes important notes about using Clang as a compiler for an end-user, documenting the supported features, command line options, etc.
  23. [23]
    Built-in types (C++) - Microsoft Learn
    Aug 11, 2025 · Type long double is a floating point type that is larger than or equal to type double . Microsoft-specific: The representation of long double ...
  24. [24]
    Overview of x64 ABI conventions - Microsoft Learn
    Jun 25, 2025 · This topic describes the basic application binary interface (ABI) for x64, the 64-bit extension to the x86 architecture.
  25. [25]
    Intel® AVX-512 Instructions
    Jun 20, 2017 · Intel AVX-512 features include 32 vector registers each 512 bits wide, eight dedicated mask registers, 512-bit operations on packed floating ...
  26. [26]
    Building with 128-bit floating-point (long double) support for ...
    To build with long double support for AArch64 state, the following process must be followed: Obtain long double library function source files from the LLVM ...
  27. [27]
    That hasn't been the case for over a decade. - Hacker News
    Jan 6, 2019 · The ppc64 architecture (still produced by IBM) supports "double-double" precision for the long-double type, which is a bit hacky and software- ...
  28. [28]
    [PDF] IBM Power Systems S922, S914, and S924 - IBM Redbooks
    This document is a technical overview and introduction for IBM Power Systems S922, S914, and S924, machine types 9009-22A, 9009-41A, and 9009-42A.
  29. [29]
    THE SPARC ARCHITECTURE - cs.wisc.edu
    Nov 14, 1997 · The floating point numbers can be 32(single), 64 (double), or 128 (quad) bits long; they conform to the IEEE 754 standard. The quad format ...
  30. [30]
    q extension with C compilers and libraries - Google Groups
    Nov 4, 2022 · The RISC-V psABI defines long double to be of 16 bytes (size and alignment). That is also how it is implemented in GCC for e.g. PowerPC or HP-UX ...
  31. [31]
    [PDF] Calling Convention - RISC-V International
    In both RV32 and RV64, the C type long long is a 64-bit integer, float is a 32-bit IEEE 754-2008 floating-point number, double is a 64-bit IEEE 754-2008 ...Missing: format | Show results with:format
  32. [32]
    Size and alignment of basic data types - Arm Developer
    For double and long double quantities the word containing the sign, the exponent, and the most significant part of the mantissa is stored with the lower machine ...
  33. [33]
    Be Aware: Floating Point Operations on ARM Cortex-M4F - DZone
    May 1, 2019 · The answer is that the ARM Cortex-M4F has only a single precision (float) FPU, and not a double precision (double) FPU. As such, it only can do float ...<|control11|><|separator|>
  34. [34]
    Quadruple Precision, 128-bit Floating Point Arithmetic
    May 22, 2017 · Background. The IEEE 754 standard, published in 1985, defines formats for floating point numbers that occupy 32 or 64 bits of storage.
  35. [35]
  36. [36]
    IEEE Arithmetic
    The IEEE double format has a significand precision of 53 bits and occupies 64 bits overall. Two classes of extended floating-point formats: single extended and ...
  37. [37]
    [PDF] 4. Instruction tables - Agner Fog
    Sep 20, 2025 · The instruction tables contain lists of instruction latencies, throughputs, and micro-operation breakdowns for Intel, AMD, and VIA CPUs.
  38. [38]
    (PDF) Revisiting high-order Taylor methods for astrodynamics and ...
    May 4, 2021 · Detailed numerical tests focused on difficult high-precision gravitational problems in astrodynamics and celestial mechanics show how our ...
  39. [39]
    What Every Computer Scientist Should Know About Floating-Point ...
    This paper is a tutorial on those aspects of floating-point arithmetic (floating-point hereafter) that have a direct connection to systems building.
  40. [40]
    Clang command line argument reference - LLVM
    Long double options¶. Selects the long double implementation. -mlong-double-128¶. Force long double to be 128 bits. -mlong-double-64¶. Force long double to be ...
  41. [41]
    The long double trouble with MinGW and Windows - DEV Community
    Mar 17, 2025 · For example, the type long double may be implemented as the 80-bit extended precision type, which is natively supported on x86 architectures, or ...
  42. [42]
    [PDF] Cross-Platform Issues With Floating-Point Arithmetics in C++
    Of all three floating point types, long double is the least portable. Some systems do not support long double directly; on these systems, it is the same size as ...
  43. [43]
    Common Predefined Macros (The C Preprocessor)
    These macros are defined, with value 1, if (and only if) the compilation is for a target where long int and pointer both use 64-bits and int uses 32-bit. __SSP ...
  44. [44]
    P1467R9: Extended floating-point types and standard names
    Apr 22, 2022 · The type double provides at least as much precision as float , and the type long double provides at least as much precision as double . The ...Missing: P0043R0 | Show results with:P0043R0
  45. [45]
    FLD — Load Floating-Point Value
    The FLD instruction can also push the value in a selected FPU register [ST(i)] onto the stack. Here, pushing register ST(0) duplicates the stack top. When the ...
  46. [46]
  47. [47]
    x86 intrinsics list | Microsoft Learn
    Jun 25, 2025 · This document lists intrinsics that the Microsoft C/C++ compiler supports when x86 is targeted. For information about individual intrinsics, see these ...
  48. [48]
    VFP double-precision format - Arm Developer
    In a little-endian memory system, the least significant word appears at the lower memory address and the most significant word at the higher memory address. In ...
  49. [49]
    Floating-Point Reference Sheet for Intel® Architecture
    Mar 29, 2021 · This section provides a bit-level map of the x87 floating-point control word (FPCW), x87 floating-point status word (FPSW), and the MXCSR.
  50. [50]
    Linux FPU - Yizhou Shan's Home Page
    The Linux FPU is a complex, user-level x86 unit, used by glibc, with each thread having its own context. The kernel does not use it directly.