## Tcl9.0.3/Tk9.0.3 Documentation > Tcl C API > PrintDbl

### Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

  NAME
    Tcl_PrintDouble — 浮動少数値から文字列への変換　 Convert floating value to string
  SYNOPSIS
    #include <tcl.h>
    Tcl_PrintDouble(interp, value, dst)
  引数 ARGUMENTS
    Tcl_Interp *interp (入力in)
    double value (入力in)
    char *dst (出力out)
  説明 DESCRIPTION
  KEYWORDS

### NAME

Tcl_PrintDouble — 浮動少数値から文字列への変換　 Convert floating value to string

### SYNOPSIS

#include <tcl.h>
Tcl_PrintDouble(interp, value, dst)

### 引数 ARGUMENTS

Tcl_Interp *interp (入力in)
  この引数は無視される｡　 This argument is ignored.

double value (入力in)
  変換されるべき浮動少数点値｡　 Floating-point value to be converted.

char *dst (出力out)
  文字列表現値valueを保存する場所｡少なくとも､貯蔵のTCL_DOUBLE_SPACE 文字を有してなければならない｡　 Where to store the string representing value. Must have at least TCL_DOUBLE_SPACE characters of storage.

### 説明 DESCRIPTION

Tcl_PrintDouble は値 value を表現する文字列を生成し､記憶域内の dst によって与えられる位置に保存する｡それは文字列を生成するために特別な捩れのある %g 書式を使う: 文字列は “.” か “e” を必ず含みそれにより整数とは異なる様に見える｡ここで %g は小数点のない整数を生成し､ Tcl_PrintDouble は “.0” を付ける｡ Tcl_PrintDouble generates a string that represents the value of value and stores it in memory at the location given by dst. It uses %g format to generate the string, with one special twist: the string is guaranteed to contain either a “.” or an “e” so that it does not look like an integer. Where %g would generate an integer with no decimal point, Tcl_PrintDouble adds “.0”.

結果は､与えられた文字列が表す同じ数を Tcl_NewDoubleObj が生成する方法で表現するに必要な最小の数字を有する｡変換の為に偶数化への IEEE 意味論の丸めを適用する｡ The result will have the fewest digits needed to represent the number in such a way that Tcl_NewDoubleObj will generate the same number when presented with the given string. IEEE semantics of rounding to even apply to the conversion.

### KEYWORDS

conversion, double-precision, floating-point, string
Copyright © 1989-1993 The Regents of the University of California.
Copyright © 1994-1997 Sun Microsystems, Inc.
Copyright © 1989-1993 The Regents of the University of California.
Copyright © 1994-1997 Sun Microsystems, Inc.