選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

31 行
523 B

#include <string.h>
#include "double-conversion.h"
using namespace double_conversion;
#ifdef __cplusplus
extern "C" {
#endif
// Returns the length of the string
int
double_to_shortest(char *buf, size_t size, double val)
{
int len = -1;
StringBuilder builder(buf, size);
const DoubleToStringConverter& dc =
DoubleToStringConverter::EcmaScriptConverter();
dc.ToShortest(val, &builder);
len = builder.position();
buf = builder.Finalize();
return len;
}
#ifdef __cplusplus
}
#endif