|
From: Per W. <pw...@ia...> - 2006-02-24 12:48:59
|
VC++ doesn't have an long double data type. A long double variable will be 8 byte large, just as a double. In short, there will be no problem trying to send a long double parameter to a variadic function. Both sender and receiver will assume 8 bytes storage size. It is only code that relies on extra precision and/or range of a long double that will have problems. For example a numeric algorithm using a numerically unstable method of solving an equation might diverge with double numbers while it always have enough precision to converge on a solution with true long doubles. /Per W On Fri, 24 Feb 2006, Daniel K. O. wrote: > Per Westermark escreveu: > > %Lf specifies long double (when supported) > > > > Which the MS runtime doesn't seem to support... from my experiences (I > don't have the MS compiler, I just asked somebody else to compile some > code and send me the program output and some assembly dumps), VC++ > "demotes" long doubles to plain doubles in printf. > > But now that you mentioned %Lf, I would like to confirm with anyone here > who has VC++; what does happen when trying to printf a long double on > VC++? For me, it looks like VC++ tries a "magic" conversion in variadic > functions, but if it is true, it may break legit code (when trying to > va_arg a long double where a plain double was put). > > > > --- > Daniel K. O. > > |