infix
A JIT-Powered FFI Library for C
Loading...
Searching...
No Matches
Ch04_LongDouble.c File Reference

Cookbook Chapter 4: Handling long double More...

#include <infix/infix.h>
#include <math.h>
#include <stdio.h>
Include dependency graph for Ch04_LongDouble.c:

Functions

static long double native_sqrtl (long double x)
 
int main ()
 

Detailed Description

Cookbook Chapter 4: Handling long double

This example demonstrates how to call a function that uses the long double type. The size and ABI handling of long double are highly platform-specific:

  • On x86-64 Linux/BSD (System V ABI), it is often an 80-bit extended-precision float passed on the x87 FPU stack.
  • On AArch64, it is a 128-bit quadruple-precision float.
  • On Windows (MSVC) and macOS, it is typically just an alias for double (64 bits).

The infix keyword longdouble correctly resolves to the appropriate ABI handling on each platform, making the signature portable.

Function Documentation

◆ main()

int main ( void  )

◆ native_sqrtl()

static long double native_sqrtl ( long double  x)
static