HAIDOX
HAIDOX Help

Math Engine Reference: Binary Float

개요

IEEE 754 binary32/binary64 value, text, comparison, and backend C ABI.

Integer bit patterns are the canonical representation at the ABI boundary; no compiler bitfield, host long, or native endian layout is exposed. Text conversion is ASCII and locale-independent. Binary floating values are not a financial amount representation.

관련 public header

공개 API

Header 사용 시작

이 module의 public declaration을 사용하려면 installed SDK의 다음 header를 include한다.

#include <math_engine/math_engine_binary_float.h>

Type과 callback

math_engine_binary_format_t

Storage format identifier.

typedef enum math_engine_binary_format {
    /** 유효한 storage format이 없음을 나타내는 입력/초기화 sentinel이다. */
    MATH_ENGINE_BINARY_FORMAT_INVALID = 0,
    /** IEEE 754 binary32: 1 sign, 8 exponent, 23 fraction bit 형식이다. */
    MATH_ENGINE_BINARY_FORMAT_32 = 1,
    /** IEEE 754 binary64: 1 sign, 11 exponent, 52 fraction bit 형식이다. */
    MATH_ENGINE_BINARY_FORMAT_64 = 2
} math_engine_binary_format_t;
  • math_engine_binary_format_t.MATH_ENGINE_BINARY_FORMAT_INVALID

    유효한 storage format이 없음을 나타내는 입력/초기화 sentinel이다.

    /** 유효한 storage format이 없음을 나타내는 입력/초기화 sentinel이다. */
        MATH_ENGINE_BINARY_FORMAT_INVALID = 0,
    
  • math_engine_binary_format_t.MATH_ENGINE_BINARY_FORMAT_32

    IEEE 754 binary32: 1 sign, 8 exponent, 23 fraction bit 형식이다.

    /** IEEE 754 binary32: 1 sign, 8 exponent, 23 fraction bit 형식이다. */
        MATH_ENGINE_BINARY_FORMAT_32 = 1,
    
  • math_engine_binary_format_t.MATH_ENGINE_BINARY_FORMAT_64

    IEEE 754 binary64: 1 sign, 11 exponent, 52 fraction bit 형식이다.

    /** IEEE 754 binary64: 1 sign, 11 exponent, 52 fraction bit 형식이다. */
        MATH_ENGINE_BINARY_FORMAT_64 = 2,
    

math_engine_binary_class_t

IEEE value class independent of sign.

typedef enum math_engine_binary_class {
    /** 아직 분류되지 않았거나 유효하지 않은 class sentinel이다. */
    MATH_ENGINE_BINARY_CLASS_INVALID = 0,
    /** 부호와 무관하게 exponent와 fraction field가 모두 0인 값이다. */
    MATH_ENGINE_BINARY_CLASS_ZERO = 1,
    /** Exponent field는 0이고 fraction field는 0이 아닌 subnormal 값이다. */
    MATH_ENGINE_BINARY_CLASS_SUBNORMAL = 2,
    /** Exponent field가 0과 all-ones 사이인 유한 normal 값이다. */
    MATH_ENGINE_BINARY_CLASS_NORMAL = 3,
    /** Exponent는 all-ones이고 fraction은 0인 양/음의 infinity다. */
    MATH_ENGINE_BINARY_CLASS_INFINITY = 4,
    /** Exponent는 all-ones이고 fraction은 0이 아닌 quiet/signaling NaN이다. */
    MATH_ENGINE_BINARY_CLASS_NAN = 5
} math_engine_binary_class_t;
  • math_engine_binary_class_t.MATH_ENGINE_BINARY_CLASS_INVALID

    아직 분류되지 않았거나 유효하지 않은 class sentinel이다.

    /** 아직 분류되지 않았거나 유효하지 않은 class sentinel이다. */
        MATH_ENGINE_BINARY_CLASS_INVALID = 0,
    
  • math_engine_binary_class_t.MATH_ENGINE_BINARY_CLASS_ZERO

    부호와 무관하게 exponent와 fraction field가 모두 0인 값이다.

    /** 부호와 무관하게 exponent와 fraction field가 모두 0인 값이다. */
        MATH_ENGINE_BINARY_CLASS_ZERO = 1,
    
  • math_engine_binary_class_t.MATH_ENGINE_BINARY_CLASS_SUBNORMAL

    Exponent field는 0이고 fraction field는 0이 아닌 subnormal 값이다.

    /** Exponent field는 0이고 fraction field는 0이 아닌 subnormal 값이다. */
        MATH_ENGINE_BINARY_CLASS_SUBNORMAL = 2,
    
  • math_engine_binary_class_t.MATH_ENGINE_BINARY_CLASS_NORMAL

    Exponent field가 0과 all-ones 사이인 유한 normal 값이다.

    /** Exponent field가 0과 all-ones 사이인 유한 normal 값이다. */
        MATH_ENGINE_BINARY_CLASS_NORMAL = 3,
    
  • math_engine_binary_class_t.MATH_ENGINE_BINARY_CLASS_INFINITY

    Exponent는 all-ones이고 fraction은 0인 양/음의 infinity다.

    /** Exponent는 all-ones이고 fraction은 0인 양/음의 infinity다. */
        MATH_ENGINE_BINARY_CLASS_INFINITY = 4,
    
  • math_engine_binary_class_t.MATH_ENGINE_BINARY_CLASS_NAN

    Exponent는 all-ones이고 fraction은 0이 아닌 quiet/signaling NaN이다.

    /** Exponent는 all-ones이고 fraction은 0이 아닌 quiet/signaling NaN이다. */
        MATH_ENGINE_BINARY_CLASS_NAN = 5,
    

math_engine_binary_endian_t

Host byte order reported for diagnostics only.

typedef enum math_engine_binary_endian {
    /** Byte order를 관찰할 수 없었음을 나타내는 diagnostic sentinel이다. */
    MATH_ENGINE_BINARY_ENDIAN_INVALID = 0,
    /** 가장 낮은 유효 byte가 가장 낮은 주소에 저장되는 host byte order다. */
    MATH_ENGINE_BINARY_ENDIAN_LITTLE = 1,
    /** 가장 높은 유효 byte가 가장 낮은 주소에 저장되는 host byte order다. */
    MATH_ENGINE_BINARY_ENDIAN_BIG = 2
} math_engine_binary_endian_t;
  • math_engine_binary_endian_t.MATH_ENGINE_BINARY_ENDIAN_INVALID

    Byte order를 관찰할 수 없었음을 나타내는 diagnostic sentinel이다.

    /** Byte order를 관찰할 수 없었음을 나타내는 diagnostic sentinel이다. */
        MATH_ENGINE_BINARY_ENDIAN_INVALID = 0,
    
  • math_engine_binary_endian_t.MATH_ENGINE_BINARY_ENDIAN_LITTLE

    가장 낮은 유효 byte가 가장 낮은 주소에 저장되는 host byte order다.

    /** 가장 낮은 유효 byte가 가장 낮은 주소에 저장되는 host byte order다. */
        MATH_ENGINE_BINARY_ENDIAN_LITTLE = 1,
    
  • math_engine_binary_endian_t.MATH_ENGINE_BINARY_ENDIAN_BIG

    가장 높은 유효 byte가 가장 낮은 주소에 저장되는 host byte order다.

    /** 가장 높은 유효 byte가 가장 낮은 주소에 저장되는 host byte order다. */
        MATH_ENGINE_BINARY_ENDIAN_BIG = 2,
    

math_engine_binary_text_format_t

Locale-independent output notation.

typedef enum math_engine_binary_text_format {
    /** 유효한 출력 표기법이 없음을 나타내며 format API 입력으로 거부된다. */
    MATH_ENGINE_BINARY_TEXT_FORMAT_INVALID = 0,
    /** Minimum-length decimal that round-trips to the same bits. */
    MATH_ENGINE_BINARY_TEXT_FORMAT_SHORTEST = 1,
    /** 소수점 뒤 =precision=개 digit을 갖는 ASCII scientific 표기다. */
    MATH_ENGINE_BINARY_TEXT_FORMAT_SCIENTIFIC = 2,
    /** 소수점 뒤 =precision=개 digit을 갖는 ASCII fixed 표기다. */
    MATH_ENGINE_BINARY_TEXT_FORMAT_FIXED = 3,
    /** =precision=개 hexadecimal fractional digit을 갖는 C99-style hexadecimal 표기다. */
    MATH_ENGINE_BINARY_TEXT_FORMAT_HEXADECIMAL = 4
} math_engine_binary_text_format_t;
  • math_engine_binary_text_format_t.MATH_ENGINE_BINARY_TEXT_FORMAT_INVALID

    유효한 출력 표기법이 없음을 나타내며 format API 입력으로 거부된다.

    /** 유효한 출력 표기법이 없음을 나타내며 format API 입력으로 거부된다. */
        MATH_ENGINE_BINARY_TEXT_FORMAT_INVALID = 0,
    
  • math_engine_binary_text_format_t.MATH_ENGINE_BINARY_TEXT_FORMAT_SHORTEST

    Minimum-length decimal that round-trips to the same bits.

    /** Minimum-length decimal that round-trips to the same bits. */
        MATH_ENGINE_BINARY_TEXT_FORMAT_SHORTEST = 1,
    
  • math_engine_binary_text_format_t.MATH_ENGINE_BINARY_TEXT_FORMAT_SCIENTIFIC

    소수점 뒤 precision 개 digit을 갖는 ASCII scientific 표기다.

    /** 소수점 뒤 =precision=개 digit을 갖는 ASCII scientific 표기다. */
        MATH_ENGINE_BINARY_TEXT_FORMAT_SCIENTIFIC = 2,
    
  • math_engine_binary_text_format_t.MATH_ENGINE_BINARY_TEXT_FORMAT_FIXED

    소수점 뒤 precision 개 digit을 갖는 ASCII fixed 표기다.

    /** 소수점 뒤 =precision=개 digit을 갖는 ASCII fixed 표기다. */
        MATH_ENGINE_BINARY_TEXT_FORMAT_FIXED = 3,
    
  • math_engine_binary_text_format_t.MATH_ENGINE_BINARY_TEXT_FORMAT_HEXADECIMAL

    precision 개 hexadecimal fractional digit을 갖는 C99-style hexadecimal 표기다.

    /** =precision=개 hexadecimal fractional digit을 갖는 C99-style hexadecimal 표기다. */
        MATH_ENGINE_BINARY_TEXT_FORMAT_HEXADECIMAL = 4,
    

math_engine_binary_operation_t

Basic arithmetic operation.

typedef enum math_engine_binary_operation {
    /** 유효한 arithmetic operation이 없음을 나타내는 sentinel이다. */
    MATH_ENGINE_BINARY_OPERATION_INVALID = 0,
    /** =lhs + rhs=를 explicit rounding으로 계산한다. */
    MATH_ENGINE_BINARY_OPERATION_ADD = 1,
    /** =lhs - rhs=를 explicit rounding으로 계산한다. */
    MATH_ENGINE_BINARY_OPERATION_SUBTRACT = 2,
    /** =lhs * rhs=를 explicit rounding으로 계산한다. */
    MATH_ENGINE_BINARY_OPERATION_MULTIPLY = 3,
    /** =lhs / rhs=를 계산하며 =rhs=가 0이면 요청을 거부한다. */
    MATH_ENGINE_BINARY_OPERATION_DIVIDE = 4
} math_engine_binary_operation_t;
  • math_engine_binary_operation_t.MATH_ENGINE_BINARY_OPERATION_INVALID

    유효한 arithmetic operation이 없음을 나타내는 sentinel이다.

    /** 유효한 arithmetic operation이 없음을 나타내는 sentinel이다. */
        MATH_ENGINE_BINARY_OPERATION_INVALID = 0,
    
  • math_engine_binary_operation_t.MATH_ENGINE_BINARY_OPERATION_ADD

    lhs + rhs 를 explicit rounding으로 계산한다.

    /** =lhs + rhs=를 explicit rounding으로 계산한다. */
        MATH_ENGINE_BINARY_OPERATION_ADD = 1,
    
  • math_engine_binary_operation_t.MATH_ENGINE_BINARY_OPERATION_SUBTRACT

    lhs - rhs 를 explicit rounding으로 계산한다.

    /** =lhs - rhs=를 explicit rounding으로 계산한다. */
        MATH_ENGINE_BINARY_OPERATION_SUBTRACT = 2,
    
  • math_engine_binary_operation_t.MATH_ENGINE_BINARY_OPERATION_MULTIPLY

    lhs * rhs 를 explicit rounding으로 계산한다.

    /** =lhs * rhs=를 explicit rounding으로 계산한다. */
        MATH_ENGINE_BINARY_OPERATION_MULTIPLY = 3,
    
  • math_engine_binary_operation_t.MATH_ENGINE_BINARY_OPERATION_DIVIDE

    lhs / rhs 를 계산하며 rhs 가 0이면 요청을 거부한다.

    /** =lhs / rhs=를 계산하며 =rhs=가 0이면 요청을 거부한다. */
        MATH_ENGINE_BINARY_OPERATION_DIVIDE = 4,
    

math_engine_binary_implementation_t

Compiled implementation selected for this public scalar contract.

typedef enum math_engine_binary_implementation {
    /** Backend implementation을 선택하지 못했음을 나타내는 sentinel이다. */
    MATH_ENGINE_BINARY_IMPLEMENTATION_INVALID = 0,
    /** 한 lane의 표준 binary32/binary64 연산을 사용하는 portable scalar 구현이다. */
    MATH_ENGINE_BINARY_IMPLEMENTATION_PORTABLE_SCALAR = 1,
    /** 128-bit vector register를 사용하는 선택적 SIMD implementation 식별자다. */
    MATH_ENGINE_BINARY_IMPLEMENTATION_SIMD128 = 2,
    /** 256-bit vector register를 사용하는 선택적 SIMD implementation 식별자다. */
    MATH_ENGINE_BINARY_IMPLEMENTATION_SIMD256 = 3,
    /** Binary64보다 넓은 intermediate precision을 사용하는 선택적 implementation 식별자다. */
    MATH_ENGINE_BINARY_IMPLEMENTATION_EXTENDED = 4
} math_engine_binary_implementation_t;
  • math_engine_binary_implementation_t.MATH_ENGINE_BINARY_IMPLEMENTATION_INVALID

    Backend implementation을 선택하지 못했음을 나타내는 sentinel이다.

    /** Backend implementation을 선택하지 못했음을 나타내는 sentinel이다. */
        MATH_ENGINE_BINARY_IMPLEMENTATION_INVALID = 0,
    
  • math_engine_binary_implementation_t.MATH_ENGINE_BINARY_IMPLEMENTATION_PORTABLE_SCALAR

    한 lane의 표준 binary32/binary64 연산을 사용하는 portable scalar 구현이다.

    /** 한 lane의 표준 binary32/binary64 연산을 사용하는 portable scalar 구현이다. */
        MATH_ENGINE_BINARY_IMPLEMENTATION_PORTABLE_SCALAR = 1,
    
  • math_engine_binary_implementation_t.MATH_ENGINE_BINARY_IMPLEMENTATION_SIMD128

    128-bit vector register를 사용하는 선택적 SIMD implementation 식별자다.

    /** 128-bit vector register를 사용하는 선택적 SIMD implementation 식별자다. */
        MATH_ENGINE_BINARY_IMPLEMENTATION_SIMD128 = 2,
    
  • math_engine_binary_implementation_t.MATH_ENGINE_BINARY_IMPLEMENTATION_SIMD256

    256-bit vector register를 사용하는 선택적 SIMD implementation 식별자다.

    /** 256-bit vector register를 사용하는 선택적 SIMD implementation 식별자다. */
        MATH_ENGINE_BINARY_IMPLEMENTATION_SIMD256 = 3,
    
  • math_engine_binary_implementation_t.MATH_ENGINE_BINARY_IMPLEMENTATION_EXTENDED

    Binary64보다 넓은 intermediate precision을 사용하는 선택적 implementation 식별자다.

    /** Binary64보다 넓은 intermediate precision을 사용하는 선택적 implementation 식별자다. */
        MATH_ENGINE_BINARY_IMPLEMENTATION_EXTENDED = 4,
    

math_engine_binary_environment_t

Immutable description of the linked binary floating environment.

typedef struct math_engine_binary_environment {
    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary_environment_t)=. */
    uint32_t struct_size;
    /** ABI version; caller sets =MATH_ENGINE_BINARY_ENVIRONMENT_VERSION_1=. */
    uint32_t struct_version;
    /** Floating representation radix. Version 1 지원 환경에서는 항상 2다. */
    uint32_t radix;
    /** Diagnostic host byte order인 =math_engine_binary_endian_t= 값이다. */
    uint32_t endian;
    /** =float= object representation의 bit 수. 지원 환경에서는 32다. */
    uint32_t binary32_storage_bits;
    /** Hidden leading bit를 포함한 binary32 significand precision. 단위는 bit이며 24다. */
    uint32_t binary32_precision_bits;
    /** C =FLT_MIN_EXP= 규약의 binary32 최소 exponent; 최소 normal은 =2^(값-1)=이다. */
    int32_t binary32_min_exponent;
    /** C =FLT_MAX_EXP= 규약의 binary32 최대 exponent; 모든 finite 값은 =2^값=보다 작다. */
    int32_t binary32_max_exponent;
    /** =double= object representation의 bit 수. 지원 환경에서는 64다. */
    uint32_t binary64_storage_bits;
    /** Hidden leading bit를 포함한 binary64 significand precision. 단위는 bit이며 53이다. */
    uint32_t binary64_precision_bits;
    /** C =DBL_MIN_EXP= 규약의 binary64 최소 exponent; 최소 normal은 =2^(값-1)=이다. */
    int32_t binary64_min_exponent;
    /** C =DBL_MAX_EXP= 규약의 binary64 최대 exponent; 모든 finite 값은 =2^값=보다 작다. */
    int32_t binary64_max_exponent;
    /** 조회 시 caller thread의 =math_engine_binary_rounding_t= rounding direction이다. */
    uint32_t current_rounding;
    /** binary32 subnormal 연산이 flush되지 않으면 1, flush되면 0이다. */
    uint32_t binary32_subnormal_preserved;
    /** binary64 subnormal 연산이 flush되지 않으면 1, flush되면 0이다. */
    uint32_t binary64_subnormal_preserved;
    /** Floating environment에서 유효한 current rounding을 관찰했으면 1, 아니면 0이다. */
    uint32_t fenv_observed;
    /** Radix, endian, width, precision, exponent, rounding, subnormal field의 FNV-1a64 값이다. */
    uint64_t environment_fingerprint;
    /** Version 1에서는 두 element 모두 0이어야 하는 future-use storage다. */
    uint64_t reserved[2];
} math_engine_binary_environment_t;
  • math_engine_binary_environment_t.struct_size

    Exact ABI byte size; caller sets sizeof(math_engine_binary_environment_t).

    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary_environment_t)=. */
        uint32_t struct_size;
    
  • math_engine_binary_environment_t.struct_version

    ABI version; caller sets MATH_ENGINE_BINARY_ENVIRONMENT_VERSION_1.

    /** ABI version; caller sets =MATH_ENGINE_BINARY_ENVIRONMENT_VERSION_1=. */
        uint32_t struct_version;
    
  • math_engine_binary_environment_t.radix

    Floating representation radix. Version 1 지원 환경에서는 항상 2다.

    /** Floating representation radix. Version 1 지원 환경에서는 항상 2다. */
        uint32_t radix;
    
  • math_engine_binary_environment_t.endian

    Diagnostic host byte order인 math_engine_binary_endian_t 값이다.

    /** Diagnostic host byte order인 =math_engine_binary_endian_t= 값이다. */
        uint32_t endian;
    
  • math_engine_binary_environment_t.binary32_storage_bits

    float object representation의 bit 수. 지원 환경에서는 32다.

    /** =float= object representation의 bit 수. 지원 환경에서는 32다. */
        uint32_t binary32_storage_bits;
    
  • math_engine_binary_environment_t.binary32_precision_bits

    Hidden leading bit를 포함한 binary32 significand precision. 단위는 bit이며 24다.

    /** Hidden leading bit를 포함한 binary32 significand precision. 단위는 bit이며 24다. */
        uint32_t binary32_precision_bits;
    
  • math_engine_binary_environment_t.binary32_min_exponent

    C FLT_MIN_EXP 규약의 binary32 최소 exponent; 최소 normal은 =2^(값-1)=이다.

    /** C =FLT_MIN_EXP= 규약의 binary32 최소 exponent; 최소 normal은 =2^(값-1)=이다. */
        int32_t binary32_min_exponent;
    
  • math_engine_binary_environment_t.binary32_max_exponent

    C FLT_MAX_EXP 규약의 binary32 최대 exponent; 모든 finite 값은 =2^값=보다 작다.

    /** C =FLT_MAX_EXP= 규약의 binary32 최대 exponent; 모든 finite 값은 =2^값=보다 작다. */
        int32_t binary32_max_exponent;
    
  • math_engine_binary_environment_t.binary64_storage_bits

    double object representation의 bit 수. 지원 환경에서는 64다.

    /** =double= object representation의 bit 수. 지원 환경에서는 64다. */
        uint32_t binary64_storage_bits;
    
  • math_engine_binary_environment_t.binary64_precision_bits

    Hidden leading bit를 포함한 binary64 significand precision. 단위는 bit이며 53이다.

    /** Hidden leading bit를 포함한 binary64 significand precision. 단위는 bit이며 53이다. */
        uint32_t binary64_precision_bits;
    
  • math_engine_binary_environment_t.binary64_min_exponent

    C DBL_MIN_EXP 규약의 binary64 최소 exponent; 최소 normal은 =2^(값-1)=이다.

    /** C =DBL_MIN_EXP= 규약의 binary64 최소 exponent; 최소 normal은 =2^(값-1)=이다. */
        int32_t binary64_min_exponent;
    
  • math_engine_binary_environment_t.binary64_max_exponent

    C DBL_MAX_EXP 규약의 binary64 최대 exponent; 모든 finite 값은 =2^값=보다 작다.

    /** C =DBL_MAX_EXP= 규약의 binary64 최대 exponent; 모든 finite 값은 =2^값=보다 작다. */
        int32_t binary64_max_exponent;
    
  • math_engine_binary_environment_t.current_rounding

    조회 시 caller thread의 math_engine_binary_rounding_t rounding direction이다.

    /** 조회 시 caller thread의 =math_engine_binary_rounding_t= rounding direction이다. */
        uint32_t current_rounding;
    
  • math_engine_binary_environment_t.binary32_subnormal_preserved

    binary32 subnormal 연산이 flush되지 않으면 1, flush되면 0이다.

    /** binary32 subnormal 연산이 flush되지 않으면 1, flush되면 0이다. */
        uint32_t binary32_subnormal_preserved;
    
  • math_engine_binary_environment_t.binary64_subnormal_preserved

    binary64 subnormal 연산이 flush되지 않으면 1, flush되면 0이다.

    /** binary64 subnormal 연산이 flush되지 않으면 1, flush되면 0이다. */
        uint32_t binary64_subnormal_preserved;
    
  • math_engine_binary_environment_t.fenv_observed

    Floating environment에서 유효한 current rounding을 관찰했으면 1, 아니면 0이다.

    /** Floating environment에서 유효한 current rounding을 관찰했으면 1, 아니면 0이다. */
        uint32_t fenv_observed;
    
  • math_engine_binary_environment_t.environment_fingerprint

    Radix, endian, width, precision, exponent, rounding, subnormal field의 FNV-1a64 값이다.

    /** Radix, endian, width, precision, exponent, rounding, subnormal field의 FNV-1a64 값이다. */
        uint64_t environment_fingerprint;
    
  • math_engine_binary_environment_t.reserved

    Version 1에서는 두 element 모두 0이어야 하는 future-use storage다.

    /** Version 1에서는 두 element 모두 0이어야 하는 future-use storage다. */
        uint64_t reserved[2];
    

math_engine_binary_value_info_t

Canonical classification and raw fields for binary32 or binary64.

typedef struct math_engine_binary_value_info {
    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary_value_info_t)=. */
    uint32_t struct_size;
    /** ABI version; caller sets =MATH_ENGINE_BINARY_VALUE_INFO_VERSION_1=. */
    uint32_t struct_version;
    /** 검사한 값의 storage format인 =math_engine_binary_format_t= 값이다. */
    uint32_t format;
    /** 부호와 독립적인 =math_engine_binary_class_t= 분류다. */
    uint32_t value_class;
    /** Raw sign field. 음수 bit pattern이면 1, 양수 bit pattern이면 0이다. */
    uint32_t sign_bit;
    /** 현재는 =MATH_ENGINE_BINARY_VALUE_FLAG_QUIET_NAN=만 허용되는 value bitset이다. */
    uint32_t flags;
    /** Biased raw exponent field. Binary32는 8 bit, binary64는 11 bit 범위다. */
    uint32_t exponent_bits;
    /** Version 1에서는 0이어야 하는 alignment/future-use field다. */
    uint32_t reserved32;
    /** Hidden bit를 제외한 raw fraction field. Binary32 23 bit 또는 binary64 52 bit다. */
    uint64_t significand_bits;
    /** NaN이면 quiet bit를 제외한 payload, 다른 class이면 0이다. */
    uint64_t nan_payload;
    /** 전체 canonical IEEE bit pattern. Binary32이면 상위 32 bit는 0이다. */
    uint64_t bits;
    /** Version 1에서는 0이어야 하는 future-use field다. */
    uint64_t reserved64;
} math_engine_binary_value_info_t;
  • math_engine_binary_value_info_t.struct_size

    Exact ABI byte size; caller sets sizeof(math_engine_binary_value_info_t).

    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary_value_info_t)=. */
        uint32_t struct_size;
    
  • math_engine_binary_value_info_t.struct_version

    ABI version; caller sets MATH_ENGINE_BINARY_VALUE_INFO_VERSION_1.

    /** ABI version; caller sets =MATH_ENGINE_BINARY_VALUE_INFO_VERSION_1=. */
        uint32_t struct_version;
    
  • math_engine_binary_value_info_t.format

    검사한 값의 storage format인 math_engine_binary_format_t 값이다.

    /** 검사한 값의 storage format인 =math_engine_binary_format_t= 값이다. */
        uint32_t format;
    
  • math_engine_binary_value_info_t.value_class

    부호와 독립적인 math_engine_binary_class_t 분류다.

    /** 부호와 독립적인 =math_engine_binary_class_t= 분류다. */
        uint32_t value_class;
    
  • math_engine_binary_value_info_t.sign_bit

    Raw sign field. 음수 bit pattern이면 1, 양수 bit pattern이면 0이다.

    /** Raw sign field. 음수 bit pattern이면 1, 양수 bit pattern이면 0이다. */
        uint32_t sign_bit;
    
  • math_engine_binary_value_info_t.flags

    현재는 MATH_ENGINE_BINARY_VALUE_FLAG_QUIET_NAN 만 허용되는 value bitset이다.

    /** 현재는 =MATH_ENGINE_BINARY_VALUE_FLAG_QUIET_NAN=만 허용되는 value bitset이다. */
        uint32_t flags;
    
  • math_engine_binary_value_info_t.exponent_bits

    Biased raw exponent field. Binary32는 8 bit, binary64는 11 bit 범위다.

    /** Biased raw exponent field. Binary32는 8 bit, binary64는 11 bit 범위다. */
        uint32_t exponent_bits;
    
  • math_engine_binary_value_info_t.reserved32

    Version 1에서는 0이어야 하는 alignment/future-use field다.

    /** Version 1에서는 0이어야 하는 alignment/future-use field다. */
        uint32_t reserved32;
    
  • math_engine_binary_value_info_t.significand_bits

    Hidden bit를 제외한 raw fraction field. Binary32 23 bit 또는 binary64 52 bit다.

    /** Hidden bit를 제외한 raw fraction field. Binary32 23 bit 또는 binary64 52 bit다. */
        uint64_t significand_bits;
    
  • math_engine_binary_value_info_t.nan_payload

    NaN이면 quiet bit를 제외한 payload, 다른 class이면 0이다.

    /** NaN이면 quiet bit를 제외한 payload, 다른 class이면 0이다. */
        uint64_t nan_payload;
    
  • math_engine_binary_value_info_t.bits

    전체 canonical IEEE bit pattern. Binary32이면 상위 32 bit는 0이다.

    /** 전체 canonical IEEE bit pattern. Binary32이면 상위 32 bit는 0이다. */
        uint64_t bits;
    
  • math_engine_binary_value_info_t.reserved64

    Version 1에서는 0이어야 하는 future-use field다.

    /** Version 1에서는 0이어야 하는 future-use field다. */
        uint64_t reserved64;
    

math_engine_binary32_operation_result_t

Arithmetic result and IEEE exception summary for binary32.

typedef struct math_engine_binary32_operation_result {
    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary32_operation_result_t)=. */
    uint32_t struct_size;
    /** ABI version; caller sets =MATH_ENGINE_BINARY_OPERATION_RESULT_VERSION_1=. */
    uint32_t struct_version;
    /** 실행된 =math_engine_binary_operation_t= 값이다. */
    uint32_t operation;
    /** =value=의 부호 독립적인 =math_engine_binary_class_t= 분류다. */
    uint32_t value_class;
    /** 선택된 rounding으로 얻은 raw binary32 수치 결과이며 물리 단위를 해석하지 않는다. */
    float value;
    /** =value=의 전체 32-bit IEEE binary32 object bit pattern이다. */
    uint32_t value_bits;
    /** =MATH_ENGINE_BINARY_RESULT_FLAG_*= 조합인 exception/정확성 bitset이다. */
    uint32_t flags;
    /** 이 연산에 적용한 =math_engine_binary_rounding_t= 값이다. */
    uint32_t rounding;
    /** Version 1에서는 0이어야 하는 future-use field다. */
    uint64_t reserved;
} math_engine_binary32_operation_result_t;
  • math_engine_binary32_operation_result_t.struct_size

    Exact ABI byte size; caller sets sizeof(math_engine_binary32_operation_result_t).

    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary32_operation_result_t)=. */
        uint32_t struct_size;
    
  • math_engine_binary32_operation_result_t.struct_version

    ABI version; caller sets MATH_ENGINE_BINARY_OPERATION_RESULT_VERSION_1.

    /** ABI version; caller sets =MATH_ENGINE_BINARY_OPERATION_RESULT_VERSION_1=. */
        uint32_t struct_version;
    
  • math_engine_binary32_operation_result_t.operation

    실행된 math_engine_binary_operation_t 값이다.

    /** 실행된 =math_engine_binary_operation_t= 값이다. */
        uint32_t operation;
    
  • math_engine_binary32_operation_result_t.value_class

    value 의 부호 독립적인 math_engine_binary_class_t 분류다.

    /** =value=의 부호 독립적인 =math_engine_binary_class_t= 분류다. */
        uint32_t value_class;
    
  • math_engine_binary32_operation_result_t.value

    선택된 rounding으로 얻은 raw binary32 수치 결과이며 물리 단위를 해석하지 않는다.

    /** 선택된 rounding으로 얻은 raw binary32 수치 결과이며 물리 단위를 해석하지 않는다. */
        float value;
    
  • math_engine_binary32_operation_result_t.value_bits

    value 의 전체 32-bit IEEE binary32 object bit pattern이다.

    /** =value=의 전체 32-bit IEEE binary32 object bit pattern이다. */
        uint32_t value_bits;
    
  • math_engine_binary32_operation_result_t.flags

    MATH_ENGINE_BINARY_RESULT_FLAG_* 조합인 exception/정확성 bitset이다.

    /** =MATH_ENGINE_BINARY_RESULT_FLAG_*= 조합인 exception/정확성 bitset이다. */
        uint32_t flags;
    
  • math_engine_binary32_operation_result_t.rounding

    이 연산에 적용한 math_engine_binary_rounding_t 값이다.

    /** 이 연산에 적용한 =math_engine_binary_rounding_t= 값이다. */
        uint32_t rounding;
    
  • math_engine_binary32_operation_result_t.reserved

    Version 1에서는 0이어야 하는 future-use field다.

    /** Version 1에서는 0이어야 하는 future-use field다. */
        uint64_t reserved;
    

math_engine_binary64_operation_result_t

Arithmetic result and IEEE exception summary for binary64.

typedef struct math_engine_binary64_operation_result {
    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary64_operation_result_t)=. */
    uint32_t struct_size;
    /** ABI version; caller sets =MATH_ENGINE_BINARY_OPERATION_RESULT_VERSION_1=. */
    uint32_t struct_version;
    /** 실행된 =math_engine_binary_operation_t= 값이다. */
    uint32_t operation;
    /** =value=의 부호 독립적인 =math_engine_binary_class_t= 분류다. */
    uint32_t value_class;
    /** 선택된 rounding으로 얻은 raw binary64 수치 결과이며 물리 단위를 해석하지 않는다. */
    double value;
    /** =value=의 전체 64-bit IEEE binary64 object bit pattern이다. */
    uint64_t value_bits;
    /** =MATH_ENGINE_BINARY_RESULT_FLAG_*= 조합인 exception/정확성 bitset이다. */
    uint32_t flags;
    /** 이 연산에 적용한 =math_engine_binary_rounding_t= 값이다. */
    uint32_t rounding;
    /** Version 1에서는 0이어야 하는 future-use field다. */
    uint64_t reserved;
} math_engine_binary64_operation_result_t;
  • math_engine_binary64_operation_result_t.struct_size

    Exact ABI byte size; caller sets sizeof(math_engine_binary64_operation_result_t).

    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary64_operation_result_t)=. */
        uint32_t struct_size;
    
  • math_engine_binary64_operation_result_t.struct_version

    ABI version; caller sets MATH_ENGINE_BINARY_OPERATION_RESULT_VERSION_1.

    /** ABI version; caller sets =MATH_ENGINE_BINARY_OPERATION_RESULT_VERSION_1=. */
        uint32_t struct_version;
    
  • math_engine_binary64_operation_result_t.operation

    실행된 math_engine_binary_operation_t 값이다.

    /** 실행된 =math_engine_binary_operation_t= 값이다. */
        uint32_t operation;
    
  • math_engine_binary64_operation_result_t.value_class

    value 의 부호 독립적인 math_engine_binary_class_t 분류다.

    /** =value=의 부호 독립적인 =math_engine_binary_class_t= 분류다. */
        uint32_t value_class;
    
  • math_engine_binary64_operation_result_t.value

    선택된 rounding으로 얻은 raw binary64 수치 결과이며 물리 단위를 해석하지 않는다.

    /** 선택된 rounding으로 얻은 raw binary64 수치 결과이며 물리 단위를 해석하지 않는다. */
        double value;
    
  • math_engine_binary64_operation_result_t.value_bits

    value 의 전체 64-bit IEEE binary64 object bit pattern이다.

    /** =value=의 전체 64-bit IEEE binary64 object bit pattern이다. */
        uint64_t value_bits;
    
  • math_engine_binary64_operation_result_t.flags

    MATH_ENGINE_BINARY_RESULT_FLAG_* 조합인 exception/정확성 bitset이다.

    /** =MATH_ENGINE_BINARY_RESULT_FLAG_*= 조합인 exception/정확성 bitset이다. */
        uint32_t flags;
    
  • math_engine_binary64_operation_result_t.rounding

    이 연산에 적용한 math_engine_binary_rounding_t 값이다.

    /** 이 연산에 적용한 =math_engine_binary_rounding_t= 값이다. */
        uint32_t rounding;
    
  • math_engine_binary64_operation_result_t.reserved

    Version 1에서는 0이어야 하는 future-use field다.

    /** Version 1에서는 0이어야 하는 future-use field다. */
        uint64_t reserved;
    

math_engine_binary32_parse_result_t

Parsed binary32 plus the number of consumed input bytes.

typedef struct math_engine_binary32_parse_result {
    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary32_parse_result_t)=. */
    uint32_t struct_size;
    /** ABI version; caller sets =MATH_ENGINE_BINARY_PARSE_RESULT_VERSION_1=. */
    uint32_t struct_version;
    /** 성공적으로 변환한 binary32 값이다. */
    float value;
    /** =value=의 전체 32-bit IEEE binary32 object bit pattern이다. */
    uint32_t value_bits;
    /** 입력 시작부터 변환에 포함된 byte 수이며 =text_size= 이하다. */
    uint64_t consumed;
    /** NaN 결과에서 quiet-NaN value flag를 기록하며 그 밖에는 0이다. */
    uint32_t flags;
    /** Version 1에서는 0이어야 하는 future-use field다. */
    uint32_t reserved32;
} math_engine_binary32_parse_result_t;
  • math_engine_binary32_parse_result_t.struct_size

    Exact ABI byte size; caller sets sizeof(math_engine_binary32_parse_result_t).

    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary32_parse_result_t)=. */
        uint32_t struct_size;
    
  • math_engine_binary32_parse_result_t.struct_version

    ABI version; caller sets MATH_ENGINE_BINARY_PARSE_RESULT_VERSION_1.

    /** ABI version; caller sets =MATH_ENGINE_BINARY_PARSE_RESULT_VERSION_1=. */
        uint32_t struct_version;
    
  • math_engine_binary32_parse_result_t.value

    성공적으로 변환한 binary32 값이다.

    /** 성공적으로 변환한 binary32 값이다. */
        float value;
    
  • math_engine_binary32_parse_result_t.value_bits

    value 의 전체 32-bit IEEE binary32 object bit pattern이다.

    /** =value=의 전체 32-bit IEEE binary32 object bit pattern이다. */
        uint32_t value_bits;
    
  • math_engine_binary32_parse_result_t.consumed

    입력 시작부터 변환에 포함된 byte 수이며 text_size 이하다.

    /** 입력 시작부터 변환에 포함된 byte 수이며 =text_size= 이하다. */
        uint64_t consumed;
    
  • math_engine_binary32_parse_result_t.flags

    NaN 결과에서 quiet-NaN value flag를 기록하며 그 밖에는 0이다.

    /** NaN 결과에서 quiet-NaN value flag를 기록하며 그 밖에는 0이다. */
        uint32_t flags;
    
  • math_engine_binary32_parse_result_t.reserved32

    Version 1에서는 0이어야 하는 future-use field다.

    /** Version 1에서는 0이어야 하는 future-use field다. */
        uint32_t reserved32;
    

math_engine_binary64_parse_result_t

Parsed binary64 plus the number of consumed input bytes.

typedef struct math_engine_binary64_parse_result {
    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary64_parse_result_t)=. */
    uint32_t struct_size;
    /** ABI version; caller sets =MATH_ENGINE_BINARY_PARSE_RESULT_VERSION_1=. */
    uint32_t struct_version;
    /** 성공적으로 변환한 binary64 값이다. */
    double value;
    /** =value=의 전체 64-bit IEEE binary64 object bit pattern이다. */
    uint64_t value_bits;
    /** 입력 시작부터 변환에 포함된 byte 수이며 =text_size= 이하다. */
    uint64_t consumed;
    /** NaN 결과에서 quiet-NaN value flag를 기록하며 그 밖에는 0이다. */
    uint32_t flags;
    /** Version 1에서는 0이어야 하는 future-use field다. */
    uint32_t reserved32;
} math_engine_binary64_parse_result_t;
  • math_engine_binary64_parse_result_t.struct_size

    Exact ABI byte size; caller sets sizeof(math_engine_binary64_parse_result_t).

    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary64_parse_result_t)=. */
        uint32_t struct_size;
    
  • math_engine_binary64_parse_result_t.struct_version

    ABI version; caller sets MATH_ENGINE_BINARY_PARSE_RESULT_VERSION_1.

    /** ABI version; caller sets =MATH_ENGINE_BINARY_PARSE_RESULT_VERSION_1=. */
        uint32_t struct_version;
    
  • math_engine_binary64_parse_result_t.value

    성공적으로 변환한 binary64 값이다.

    /** 성공적으로 변환한 binary64 값이다. */
        double value;
    
  • math_engine_binary64_parse_result_t.value_bits

    value 의 전체 64-bit IEEE binary64 object bit pattern이다.

    /** =value=의 전체 64-bit IEEE binary64 object bit pattern이다. */
        uint64_t value_bits;
    
  • math_engine_binary64_parse_result_t.consumed

    입력 시작부터 변환에 포함된 byte 수이며 text_size 이하다.

    /** 입력 시작부터 변환에 포함된 byte 수이며 =text_size= 이하다. */
        uint64_t consumed;
    
  • math_engine_binary64_parse_result_t.flags

    NaN 결과에서 quiet-NaN value flag를 기록하며 그 밖에는 0이다.

    /** NaN 결과에서 quiet-NaN value flag를 기록하며 그 밖에는 0이다. */
        uint32_t flags;
    
  • math_engine_binary64_parse_result_t.reserved32

    Version 1에서는 0이어야 하는 future-use field다.

    /** Version 1에서는 0이어야 하는 future-use field다. */
        uint32_t reserved32;
    

math_engine_binary_backend_trace_t

Mode/context-selected binary backend provenance.

typedef struct math_engine_binary_backend_trace {
    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary_backend_trace_t)=. */
    uint32_t struct_size;
    /** ABI version; caller sets =MATH_ENGINE_BINARY_BACKEND_TRACE_VERSION_1=. */
    uint32_t struct_version;
    /** Context에서 resolve된 =math_engine_mode_t= 값이다. */
    uint32_t mode;
    /** Context에서 선택된 binary32 또는 binary64 =math_engine_scalar_backend_t= 값이다. */
    uint32_t scalar_backend;
    /** 실제 연산 경로인 =math_engine_binary_implementation_t= 값이다. */
    uint32_t implementation;
    /** Hidden leading bit를 포함한 선택 backend significand precision. 단위는 bit다. */
    uint32_t precision_bits;
    /** 한 operation에 동시에 처리하는 scalar element 수다. Version 1 portable 경로는 1이다. */
    uint32_t vector_lanes;
    /** Context numeric policy의 =math_engine_binary_rounding_t= 값이다. */
    uint32_t binary_rounding;
    /** 선택 backend가 subnormal을 보존하면 1, flush하면 0이다. */
    uint32_t subnormal_preserved;
    /** Context가 deterministic execution을 요구하면 1, 아니면 0이다. */
    uint32_t deterministic;
    /** Context length tolerance의 복사본. 단위는 caller의 계산 좌표 unit이다. */
    double absolute_tolerance;
    /** Context residual tolerance의 복사본. 0 이상인 dimensionless 비율이다. */
    double relative_tolerance;
    /** 선택 backend에 필요한 단일 =MATH_ENGINE_CAPABILITY_*= bit다. */
    uint64_t required_capability;
    /** 조회에 사용한 capability descriptor의 전체 capability bitset snapshot이다. */
    uint64_t available_capabilities;
    /** 조회에 사용한 immutable resolved context의 fingerprint다. */
    uint64_t context_fingerprint;
    /** Version 1에서는 0이어야 하는 future-use field다. */
    uint64_t reserved;
} math_engine_binary_backend_trace_t;
  • math_engine_binary_backend_trace_t.struct_size

    Exact ABI byte size; caller sets sizeof(math_engine_binary_backend_trace_t).

    /** Exact ABI byte size; caller sets =sizeof(math_engine_binary_backend_trace_t)=. */
        uint32_t struct_size;
    
  • math_engine_binary_backend_trace_t.struct_version

    ABI version; caller sets MATH_ENGINE_BINARY_BACKEND_TRACE_VERSION_1.

    /** ABI version; caller sets =MATH_ENGINE_BINARY_BACKEND_TRACE_VERSION_1=. */
        uint32_t struct_version;
    
  • math_engine_binary_backend_trace_t.mode

    Context에서 resolve된 math_engine_mode_t 값이다.

    /** Context에서 resolve된 =math_engine_mode_t= 값이다. */
        uint32_t mode;
    
  • math_engine_binary_backend_trace_t.scalar_backend

    Context에서 선택된 binary32 또는 binary64 math_engine_scalar_backend_t 값이다.

    /** Context에서 선택된 binary32 또는 binary64 =math_engine_scalar_backend_t= 값이다. */
        uint32_t scalar_backend;
    
  • math_engine_binary_backend_trace_t.implementation

    실제 연산 경로인 math_engine_binary_implementation_t 값이다.

    /** 실제 연산 경로인 =math_engine_binary_implementation_t= 값이다. */
        uint32_t implementation;
    
  • math_engine_binary_backend_trace_t.precision_bits

    Hidden leading bit를 포함한 선택 backend significand precision. 단위는 bit다.

    /** Hidden leading bit를 포함한 선택 backend significand precision. 단위는 bit다. */
        uint32_t precision_bits;
    
  • math_engine_binary_backend_trace_t.vector_lanes

    한 operation에 동시에 처리하는 scalar element 수다. Version 1 portable 경로는 1이다.

    /** 한 operation에 동시에 처리하는 scalar element 수다. Version 1 portable 경로는 1이다. */
        uint32_t vector_lanes;
    
  • math_engine_binary_backend_trace_t.binary_rounding

    Context numeric policy의 math_engine_binary_rounding_t 값이다.

    /** Context numeric policy의 =math_engine_binary_rounding_t= 값이다. */
        uint32_t binary_rounding;
    
  • math_engine_binary_backend_trace_t.subnormal_preserved

    선택 backend가 subnormal을 보존하면 1, flush하면 0이다.

    /** 선택 backend가 subnormal을 보존하면 1, flush하면 0이다. */
        uint32_t subnormal_preserved;
    
  • math_engine_binary_backend_trace_t.deterministic

    Context가 deterministic execution을 요구하면 1, 아니면 0이다.

    /** Context가 deterministic execution을 요구하면 1, 아니면 0이다. */
        uint32_t deterministic;
    
  • math_engine_binary_backend_trace_t.absolute_tolerance

    Context length tolerance의 복사본. 단위는 caller의 계산 좌표 unit이다.

    /** Context length tolerance의 복사본. 단위는 caller의 계산 좌표 unit이다. */
        double absolute_tolerance;
    
  • math_engine_binary_backend_trace_t.relative_tolerance

    Context residual tolerance의 복사본. 0 이상인 dimensionless 비율이다.

    /** Context residual tolerance의 복사본. 0 이상인 dimensionless 비율이다. */
        double relative_tolerance;
    
  • math_engine_binary_backend_trace_t.required_capability

    선택 backend에 필요한 단일 MATH_ENGINE_CAPABILITY_* bit다.

    /** 선택 backend에 필요한 단일 =MATH_ENGINE_CAPABILITY_*= bit다. */
        uint64_t required_capability;
    
  • math_engine_binary_backend_trace_t.available_capabilities

    조회에 사용한 capability descriptor의 전체 capability bitset snapshot이다.

    /** 조회에 사용한 capability descriptor의 전체 capability bitset snapshot이다. */
        uint64_t available_capabilities;
    
  • math_engine_binary_backend_trace_t.context_fingerprint

    조회에 사용한 immutable resolved context의 fingerprint다.

    /** 조회에 사용한 immutable resolved context의 fingerprint다. */
        uint64_t context_fingerprint;
    
  • math_engine_binary_backend_trace_t.reserved

    Version 1에서는 0이어야 하는 future-use field다.

    /** Version 1에서는 0이어야 하는 future-use field다. */
        uint64_t reserved;
    

Macro와 constant

MATH_ENGINE_BINARY_BACKEND_TRACE_VERSION_1

math_engine_binary_backend_trace_t 의 최초 ABI version 값이다.

#define MATH_ENGINE_BINARY_BACKEND_TRACE_VERSION_1 UINT32_C(1)

MATH_ENGINE_BINARY_ENVIRONMENT_VERSION_1

math_engine_binary_environment_t 의 최초 ABI version 값이다.

#define MATH_ENGINE_BINARY_ENVIRONMENT_VERSION_1 UINT32_C(1)

MATH_ENGINE_BINARY_FORMAT_ALLOW_INFINITY

양/음의 infinity를 locale-independent ASCII로 출력하도록 허용한다.

#define MATH_ENGINE_BINARY_FORMAT_ALLOW_INFINITY (UINT32_C(1) << 0u)

MATH_ENGINE_BINARY_FORMAT_ALLOW_NAN

NaN을 locale-independent ASCII로 출력하도록 허용한다.

#define MATH_ENGINE_BINARY_FORMAT_ALLOW_NAN (UINT32_C(1) << 1u)

MATH_ENGINE_BINARY_FORMAT_VALID_FLAGS

Version 1 format API가 허용하는 모든 policy bit의 mask다. 이 밖 bit는 reserved다.

#define MATH_ENGINE_BINARY_FORMAT_VALID_FLAGS \
    (MATH_ENGINE_BINARY_FORMAT_ALLOW_INFINITY | MATH_ENGINE_BINARY_FORMAT_ALLOW_NAN)

MATH_ENGINE_BINARY_OPERATION_RESULT_VERSION_1

binary32와 binary64 operation-result POD가 공유하는 최초 ABI version 값이다.

#define MATH_ENGINE_BINARY_OPERATION_RESULT_VERSION_1 UINT32_C(1)

MATH_ENGINE_BINARY_PARSE_ALLOW_INFINITY

Case-insensitive inf 또는 infinity 와 선택적 sign 입력을 허용한다.

#define MATH_ENGINE_BINARY_PARSE_ALLOW_INFINITY (UINT32_C(1) << 1u)

MATH_ENGINE_BINARY_PARSE_ALLOW_NAN

Case-insensitive nan 과 선택적 sign 입력을 quiet NaN으로 허용한다.

#define MATH_ENGINE_BINARY_PARSE_ALLOW_NAN (UINT32_C(1) << 2u)

MATH_ENGINE_BINARY_PARSE_REQUIRE_FULL

성공하려면 consumed = text_size=여야 하며 trailing byte가 있으면 거부한다.

#define MATH_ENGINE_BINARY_PARSE_REQUIRE_FULL (UINT32_C(1) << 0u)

MATH_ENGINE_BINARY_PARSE_RESULT_VERSION_1

binary32와 binary64 parse-result POD가 공유하는 최초 ABI version 값이다.

#define MATH_ENGINE_BINARY_PARSE_RESULT_VERSION_1 UINT32_C(1)

MATH_ENGINE_BINARY_PARSE_VALID_FLAGS

Version 1 parse API가 허용하는 모든 policy bit의 mask다. 이 밖 bit는 reserved다.

#define MATH_ENGINE_BINARY_PARSE_VALID_FLAGS \
    (MATH_ENGINE_BINARY_PARSE_REQUIRE_FULL | \
     MATH_ENGINE_BINARY_PARSE_ALLOW_INFINITY | \
     MATH_ENGINE_BINARY_PARSE_ALLOW_NAN)

MATH_ENGINE_BINARY_RESULT_FLAG_EXACT

연산에서 IEEE FE_INEXACT exception이 관찰되지 않았음을 나타낸다.

#define MATH_ENGINE_BINARY_RESULT_FLAG_EXACT (UINT32_C(1) << 0u)

MATH_ENGINE_BINARY_RESULT_FLAG_INEXACT

정확한 수학 결과를 대상 binary format으로 반올림했음을 나타낸다.

#define MATH_ENGINE_BINARY_RESULT_FLAG_INEXACT (UINT32_C(1) << 1u)

MATH_ENGINE_BINARY_RESULT_FLAG_OVERFLOW

연산 중 IEEE overflow exception이 관찰되었음을 나타낸다.

#define MATH_ENGINE_BINARY_RESULT_FLAG_OVERFLOW (UINT32_C(1) << 3u)

MATH_ENGINE_BINARY_RESULT_FLAG_UNDERFLOW

연산 중 IEEE underflow exception이 관찰되었음을 나타낸다.

#define MATH_ENGINE_BINARY_RESULT_FLAG_UNDERFLOW (UINT32_C(1) << 2u)

MATH_ENGINE_BINARY_VALUE_FLAG_QUIET_NAN

NaN significand의 quiet bit가 설정되었음을 나타낸다. NaN이 아니면 이 bit는 0이다.

#define MATH_ENGINE_BINARY_VALUE_FLAG_QUIET_NAN (UINT32_C(1) << 0u)

MATH_ENGINE_BINARY_VALUE_INFO_VERSION_1

math_engine_binary_value_info_t 의 최초 ABI version 값이다.

#define MATH_ENGINE_BINARY_VALUE_INFO_VERSION_1 UINT32_C(1)

Function

math_engine_binary_environment_get

Queries IEEE widths, exponent ranges, endian, rounding, and subnormal policy.

  • 매개변수 out_environment: Caller-initialized versioned output.
  • 반환: OK, INVALID_ARGUMENT, INVALID_SIZE, or UNSUPPORTED.
  • Math Engine ownership: out_environment=caller
  • Math Engine nullable: out_environment=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary_environment_get(
    math_engine_binary_environment_t* out_environment);

math_engine_binary32_inspect

Classifies binary32 and returns its canonical integer fields.

  • 매개변수 value: Value to inspect; every bit pattern, including NaN, is accepted.
  • 매개변수 out_info: Caller-initialized versioned output, written only on success.
  • 반환: OK, INVALID_ARGUMENT, INVALID_SIZE, or UNSUPPORTED.
  • Math Engine ownership: out_info=caller
  • Math Engine nullable: out_info=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary32_inspect(
    float value, math_engine_binary_value_info_t* out_info);

math_engine_binary64_inspect

Classifies binary64 and returns its canonical integer fields.

  • 매개변수 value: Value to inspect; every bit pattern, including NaN, is accepted.
  • 매개변수 out_info: Caller-initialized versioned output, written only on success.
  • 반환: OK, INVALID_ARGUMENT, INVALID_SIZE, or UNSUPPORTED.
  • Math Engine ownership: out_info=caller
  • Math Engine nullable: out_info=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary64_inspect(
    double value, math_engine_binary_value_info_t* out_info);

math_engine_binary32_from_bits

Copies a binary32 integer bit pattern into a float without aliasing UB.

  • 매개변수 bits: Canonical IEEE binary32 bit pattern.
  • 매개변수 out_value: Output value, written only on success.
  • 반환: OK or INVALID_ARGUMENT.
  • Math Engine ownership: out_value=caller
  • Math Engine nullable: out_value=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary32_from_bits(
    uint32_t bits, float* out_value);

math_engine_binary64_from_bits

Copies a binary64 integer bit pattern into a double without aliasing UB.

  • 매개변수 bits: Canonical IEEE binary64 bit pattern.
  • 매개변수 out_value: Output value, written only on success.
  • 반환: OK or INVALID_ARGUMENT.
  • Math Engine ownership: out_value=caller
  • Math Engine nullable: out_value=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary64_from_bits(
    uint64_t bits, double* out_value);

math_engine_binary32_evaluate

Evaluates one finite binary32 operation under explicit rounding.

The function saves and restores the caller floating environment. Overflow, underflow, and inexact are returned in result flags; zero division is a failing status.

  • 매개변수 operation: Arithmetic operation to evaluate.
  • 매개변수 lhs: Finite left operand.
  • 매개변수 rhs: Finite right operand; it must be nonzero for division.
  • 매개변수 rounding: Explicit IEEE rounding direction for this operation.
  • 매개변수 out_result: Caller-initialized versioned output, written only on success.
  • 반환: OK or a documented validation, non-finite, divide-by-zero, or environment status.
  • Math Engine ownership: out_result=caller
  • Math Engine nullable: out_result=false
  • Math Engine thread_safety: fenv-thread-local
MATH_ENGINE_API math_engine_status_t math_engine_binary32_evaluate(
    math_engine_binary_operation_t operation,
    float lhs,
    float rhs,
    math_engine_binary_rounding_t rounding,
    math_engine_binary32_operation_result_t* out_result);

math_engine_binary64_evaluate

Binary64 counterpart of math_engine_binary32_evaluate.

  • 매개변수 operation: Arithmetic operation to evaluate.
  • 매개변수 lhs: Finite left operand.
  • 매개변수 rhs: Finite right operand; it must be nonzero for division.
  • 매개변수 rounding: Explicit IEEE rounding direction for this operation.
  • 매개변수 out_result: Caller-initialized versioned output, written only on success.
  • 반환: OK or a documented validation, non-finite, divide-by-zero, or environment status.
  • Math Engine ownership: out_result=caller
  • Math Engine nullable: out_result=false
  • Math Engine thread_safety: fenv-thread-local
MATH_ENGINE_API math_engine_status_t math_engine_binary64_evaluate(
    math_engine_binary_operation_t operation,
    double lhs,
    double rhs,
    math_engine_binary_rounding_t rounding,
    math_engine_binary64_operation_result_t* out_result);

math_engine_binary32_parse

Parses strict ASCII binary32 text without reading the process locale.

  • 매개변수 text: Input byte span; it need not be NUL terminated.
  • 매개변수 text_size: Number of readable bytes in text.
  • 매개변수 flags: Parse policy bits from MATH_ENGINE_BINARY_PARSE_*.
  • 매개변수 out_result: Caller-initialized versioned output, written only on success.
  • 반환: OK, validation status, OUT_OF_RANGE, or NON_FINITE.
  • Math Engine ownership: text=borrowed out_result=caller
  • Math Engine nullable: text=false out_result=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary32_parse(
    const char* text,
    uint64_t text_size,
    uint32_t flags,
    math_engine_binary32_parse_result_t* out_result);

math_engine_binary64_parse

Parses strict ASCII binary64 text without reading the process locale.

  • 매개변수 text: Input byte span; it need not be NUL terminated.
  • 매개변수 text_size: Number of readable bytes in text.
  • 매개변수 flags: Parse policy bits from MATH_ENGINE_BINARY_PARSE_*.
  • 매개변수 out_result: Caller-initialized versioned output, written only on success.
  • 반환: OK, validation status, OUT_OF_RANGE, or NON_FINITE.
  • Math Engine ownership: text=borrowed out_result=caller
  • Math Engine nullable: text=false out_result=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary64_parse(
    const char* text,
    uint64_t text_size,
    uint32_t flags,
    math_engine_binary64_parse_result_t* out_result);

math_engine_binary32_format

Formats binary32 into caller storage using locale-independent ASCII.

out_size receives the required byte count excluding NUL even when the buffer is too small. Buffer content is preserved unless capacity is at least required+1.

  • 매개변수 value: Value to format.
  • 매개변수 format: Output notation.
  • 매개변수 precision: Non-shortest 표기의 digit count로 0..768, shortest에서는 정확히 0.
  • 매개변수 flags: Format policy bits from MATH_ENGINE_BINARY_FORMAT_*.
  • 매개변수 buffer: Caller storage; it may be null only when capacity is zero.
  • 매개변수 capacity: Writable byte capacity including the terminating NUL.
  • 매개변수 out_size: Required byte count excluding NUL; written after successful conversion.
  • 반환: OK, validation status, NON_FINITE, OUT_OF_RANGE, or INSUFFICIENT_BUFFER.
  • Math Engine ownership: buffer=caller out_size=caller
  • Math Engine nullable: buffer=capacity-zero-only out_size=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary32_format(
    float value,
    math_engine_binary_text_format_t format,
    uint32_t precision,
    uint32_t flags,
    char* buffer,
    uint64_t capacity,
    uint64_t* out_size);

math_engine_binary64_format

Binary64 counterpart of math_engine_binary32_format.

  • 매개변수 value: Value to format.
  • 매개변수 format: Output notation.
  • 매개변수 precision: Non-shortest 표기의 digit count로 0..768, shortest에서는 정확히 0.
  • 매개변수 flags: Format policy bits from MATH_ENGINE_BINARY_FORMAT_*.
  • 매개변수 buffer: Caller storage; it may be null only when capacity is zero.
  • 매개변수 capacity: Writable byte capacity including the terminating NUL.
  • 매개변수 out_size: Required byte count excluding NUL; written after successful conversion.
  • 반환: OK, validation status, NON_FINITE, OUT_OF_RANGE, or INSUFFICIENT_BUFFER.
  • Math Engine ownership: buffer=caller out_size=caller
  • Math Engine nullable: buffer=capacity-zero-only out_size=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary64_format(
    double value,
    math_engine_binary_text_format_t format,
    uint32_t precision,
    uint32_t flags,
    char* buffer,
    uint64_t capacity,
    uint64_t* out_size);

math_engine_binary32_total_order

IEEE bitwise total order for binary32, including NaNs and signed zero.

  • 매개변수 lhs: Left value.
  • 매개변수 rhs: Right value.
  • 매개변수 out_order: Receives -1, 0, or 1 and is written only on success.
  • 반환: OK or INVALID_ARGUMENT.
  • Math Engine ownership: out_order=caller
  • Math Engine nullable: out_order=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary32_total_order(
    float lhs, float rhs, int32_t* out_order);

math_engine_binary64_total_order

IEEE bitwise total order for binary64, including NaNs and signed zero.

  • 매개변수 lhs: Left value.
  • 매개변수 rhs: Right value.
  • 매개변수 out_order: Receives -1, 0, or 1 and is written only on success.
  • 반환: OK or INVALID_ARGUMENT.
  • Math Engine ownership: out_order=caller
  • Math Engine nullable: out_order=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary64_total_order(
    double lhs, double rhs, int32_t* out_order);

math_engine_binary32_equal_tolerance

Finite binary32 equality using separate absolute and relative tolerances.

  • 매개변수 lhs: Finite left value.
  • 매개변수 rhs: Finite right value.
  • 매개변수 absolute_tolerance: Finite nonnegative absolute tolerance.
  • 매개변수 relative_tolerance: Finite nonnegative relative tolerance.
  • 매개변수 out_equal: Receives zero or one and is written only on success.
  • 반환: OK, INVALID_ARGUMENT, or NON_FINITE.
  • Math Engine ownership: out_equal=caller
  • Math Engine nullable: out_equal=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary32_equal_tolerance(
    float lhs, float rhs, float absolute_tolerance, float relative_tolerance,
    uint32_t* out_equal);

math_engine_binary64_equal_tolerance

Finite binary64 equality using separate absolute and relative tolerances.

  • 매개변수 lhs: Finite left value.
  • 매개변수 rhs: Finite right value.
  • 매개변수 absolute_tolerance: Finite nonnegative absolute tolerance.
  • 매개변수 relative_tolerance: Finite nonnegative relative tolerance.
  • 매개변수 out_equal: Receives zero or one and is written only on success.
  • 반환: OK, INVALID_ARGUMENT, or NON_FINITE.
  • Math Engine ownership: out_equal=caller
  • Math Engine nullable: out_equal=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary64_equal_tolerance(
    double lhs, double rhs, double absolute_tolerance, double relative_tolerance,
    uint32_t* out_equal);

math_engine_binary32_ulp_distance

Counts representable binary32 steps between finite values; both zeros are equal.

  • 매개변수 lhs: Finite left value.
  • 매개변수 rhs: Finite right value.
  • 매개변수 out_distance: Receives the unsigned ULP distance, written only on success.
  • 반환: OK, INVALID_ARGUMENT, or NON_FINITE.
  • Math Engine ownership: out_distance=caller
  • Math Engine nullable: out_distance=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary32_ulp_distance(
    float lhs, float rhs, uint64_t* out_distance);

math_engine_binary64_ulp_distance

Counts representable binary64 steps between finite values; both zeros are equal.

  • 매개변수 lhs: Finite left value.
  • 매개변수 rhs: Finite right value.
  • 매개변수 out_distance: Receives the unsigned ULP distance, written only on success.
  • 반환: OK, INVALID_ARGUMENT, or NON_FINITE.
  • Math Engine ownership: out_distance=caller
  • Math Engine nullable: out_distance=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary64_ulp_distance(
    double lhs, double rhs, uint64_t* out_distance);

math_engine_binary_backend_trace_get

Resolves the explicit binary backend trace from context and capabilities.

  • 매개변수 context: Valid resolved computation context.
  • 매개변수 capabilities: Valid runtime capability descriptor.
  • 매개변수 out_trace: Caller-initialized versioned output, written only on success.
  • 반환: OK for binary32/binary64 contexts, or UNSUPPORTED for non-binary backends.
  • Math Engine ownership: context=borrowed capabilities=borrowed out_trace=caller
  • Math Engine nullable: context=false capabilities=false out_trace=false
  • Math Engine thread_safety: safe
MATH_ENGINE_API math_engine_status_t math_engine_binary_backend_trace_get(
    const math_engine_resolved_context_t* context,
    const math_engine_capability_descriptor_t* capabilities,
    math_engine_binary_backend_trace_t* out_trace);