ReactOS 0.4.16-dev-715-ga1a169f
corecrt_internal_fltintrn.h File Reference
#include <corecrt_internal.h>
#include <float.h>
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for corecrt_internal_fltintrn.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __acrt_floating_type_traits< float >
 
struct  __acrt_floating_type_traits< float >::components_type
 
struct  __acrt_floating_type_traits< double >
 
struct  __acrt_floating_type_traits< double >::components_type
 
struct  _strflt
 

Macros

#define _In_fits_precision_(precision_arg)
 

Typedefs

typedef _strfltSTRFLT
 

Enumerations

enum class  __acrt_fp_class : uint32_t {
  finite , infinity , quiet_nan , signaling_nan ,
  indeterminate
}
 
enum class  __acrt_has_trailing_digits { trailing , no_trailing }
 
enum class  __acrt_precision_style { fixed , scientific }
 
enum class  __acrt_rounding_mode { legacy , standard }
 

Functions

__acrt_fp_class __cdecl __acrt_fp_classify (double const &value) throw ()
 
bool __cdecl __acrt_fp_is_negative (double const &value) throw ()
 
 _Success_ (return==0) errno_t __cdecl __acrt_fp_format(_In_ double const *value
 
 _Maybe_unsafe_ (_Inout_updates_z_, result_buffer_count) char *result_buffer
 
 _In_fits_precision_ (precision) size_t result_buffer_count
 
 _Out_writes_ (scratch_buffer_count) char *scratch_buffer
 
errno_t __cdecl __acrt_fp_strflt_to_string (_Out_writes_z_(buffer_count) char *buffer, _When_((digits > 0), _In_ _Pre_satisfies_(buffer_count > digits+1)) _When_((digits<=0), _In_ _Pre_satisfies_(buffer_count > 1)) _In_ size_t buffer_count, _In_ int digits, _Inout_ STRFLT value, _In_ __acrt_has_trailing_digits trailing_digits, _In_ __acrt_rounding_mode rounding_mode, _Inout_ __crt_cached_ptd_host &ptd)
 
__acrt_has_trailing_digits __cdecl __acrt_fltout (_In_ _CRT_DOUBLE value, _In_ unsigned precision, _In_ __acrt_precision_style precision_style, _Out_ STRFLT result, _Out_writes_z_(buffer_count) char *buffer, _In_ size_t buffer_count)
 

Variables

_In_ size_t scratch_buffer_count
 
_In_ size_t _In_ int format
 
_In_ size_t _In_ int _In_ int precision
 
_In_ size_t _In_ int _In_ int _In_ uint64_t options
 
_In_ size_t _In_ int _In_ int _In_ uint64_t _In_ __acrt_rounding_mode rounding_mode
 
_In_ size_t _In_ int _In_ int _In_ uint64_t _In_ __acrt_rounding_mode _Inout_ __crt_cached_ptd_host & ptd
 

Macro Definition Documentation

◆ _In_fits_precision_

#define _In_fits_precision_ (   precision_arg)
Value:
_When_(precision_arg <= 0, _Pre_satisfies_(_Curr_ > 9)) \
_When_(precision_arg > 0, _Pre_satisfies_(_Curr_ > 9 + precision_arg))
#define _Pre_satisfies_(e)
Definition: no_sal2.h:64
#define _When_(c, a)
Definition: no_sal2.h:38

Definition at line 181 of file corecrt_internal_fltintrn.h.

Typedef Documentation

◆ STRFLT

typedef _strflt* STRFLT

Definition at line 169 of file corecrt_internal_fltintrn.h.

Enumeration Type Documentation

◆ __acrt_fp_class

Enumerator
finite 
infinity 
quiet_nan 
signaling_nan 
indeterminate 

Definition at line 91 of file corecrt_internal_fltintrn.h.

◆ __acrt_has_trailing_digits

Enumerator
trailing 
no_trailing 

Definition at line 100 of file corecrt_internal_fltintrn.h.

◆ __acrt_precision_style

Enumerator
fixed 
scientific 

Definition at line 109 of file corecrt_internal_fltintrn.h.

110{
111 fixed, // 123.456 %f style requires '3' precision to generate 6 digits to format "123.456".
112 scientific // 123.456 %e style requires '5' precision to generate 6 digits to format "1.23456e+02".
113};

◆ __acrt_rounding_mode

Enumerator
legacy 
standard 

Definition at line 116 of file corecrt_internal_fltintrn.h.

Function Documentation

◆ __acrt_fltout()

__acrt_has_trailing_digits __cdecl __acrt_fltout ( _In_ _CRT_DOUBLE  value,
_In_ unsigned  precision,
_In_ __acrt_precision_style  precision_style,
_Out_ STRFLT  result,
_Out_writes_z_(buffer_count) char buffer,
_In_ size_t  buffer_count 
)

◆ __acrt_fp_classify()

__acrt_fp_class __cdecl __acrt_fp_classify ( double const value)
throw (
)
inline

Definition at line 122 of file corecrt_internal_fltintrn.h.

123{
124 using floating_traits = __acrt_floating_type_traits<double>;
125 using components_type = floating_traits::components_type;
126
127 components_type const& components = reinterpret_cast<components_type const&>(value);
128
129 bool const value_is_nan_or_infinity = components._exponent == (1u << floating_traits::exponent_bits) - 1;
130 if (!value_is_nan_or_infinity)
131 {
133 }
134 else if (components._mantissa == 0)
135 {
137 }
138 else if (components._sign == 1 && components._mantissa == floating_traits::special_nan_mantissa_mask)
139 {
141 }
142 else if (components._mantissa & floating_traits::special_nan_mantissa_mask) // Quiet NAN
143 {
145 }
146 else // Signaling NAN
147 {
149 }
150}
floating_traits::components_type components_type
Definition: cvt.cpp:357
GLenum GLenum GLuint components
Definition: glext.h:9620
Definition: pdh_main.c:94
#define const
Definition: zconf.h:233

Referenced by __acrt_fltout(), and __acrt_fp_format().

◆ __acrt_fp_is_negative()

bool __cdecl __acrt_fp_is_negative ( double const value)
throw (
)
inline

Definition at line 152 of file corecrt_internal_fltintrn.h.

153{
154 using floating_traits = __acrt_floating_type_traits<double>;
155 using components_type = floating_traits::components_type;
156
157 components_type const& components = reinterpret_cast<components_type const&>(value);
158
159 return components._sign == 1;
160}

Referenced by __acrt_fp_format().

◆ __acrt_fp_strflt_to_string()

errno_t __cdecl __acrt_fp_strflt_to_string ( _Out_writes_z_(buffer_count) char buffer,
_When_((digits > 0), _In_ _Pre_satisfies_(buffer_count > digits+1)) _When_((digits<=0), _In_ _Pre_satisfies_(buffer_count > 1)) _In_ size_t  buffer_count,
_In_ int  digits,
_Inout_ STRFLT  value,
_In_ __acrt_has_trailing_digits  trailing_digits,
_In_ __acrt_rounding_mode  rounding_mode,
_Inout_ __crt_cached_ptd_host &  ptd 
)

◆ _In_fits_precision_()

_In_fits_precision_ ( precision  )

◆ _Maybe_unsafe_()

_Maybe_unsafe_ ( _Inout_updates_z_  ,
result_buffer_count   
)

◆ _Out_writes_()

_Out_writes_ ( scratch_buffer_count  )

◆ _Success_()

_Success_ ( return  = = 0) const

Variable Documentation

◆ format

Definition at line 192 of file corecrt_internal_fltintrn.h.

◆ options

◆ precision

◆ ptd

Definition at line 196 of file corecrt_internal_fltintrn.h.

◆ rounding_mode

◆ scratch_buffer_count

_In_ size_t scratch_buffer_count

Definition at line 191 of file corecrt_internal_fltintrn.h.