-3

How to understand expression below:

inline string to_string(long double _Val)

{   // convert long double to string
char _Buf[_MAX_EXP_DIG + _MAX_SIG_DIG + 64];

_CSTD sprintf_s(_Buf, sizeof (_Buf), "%Lg", _Val);
return (string(_Buf));
}

Why two data types is used in parameter definition? Is this decried in c++ standard?

Andrey Zakcharenko
  • 311
  • 2
  • 4
  • 8

2 Answers2

0

That is the actual type. It is called long double. You can read up on it at wikipeida: https://en.wikipedia.org/wiki/Long_double

You can read more here: long double vs double

Community
  • 1
  • 1
Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
0

It's a single data type:

long double - extended precision floating point type. Does not necessarily map to types mandated by IEEE-754. Usually 80-bit x87 floating point type on x86 and x86-64 architectures.

Source: http://en.cppreference.com/w/cpp/language/types

Simon Kraemer
  • 5,700
  • 1
  • 19
  • 49