O nás     Inzerce     KontaktSpolehlivé informace o IT již od roku 2011
Hledat
Nepřehlédněte: Usnadní vám práci: Pozoruhodné IT produkty pro rok 2024
Správa dokumentů
Digitální transformace
Informační systémy
Hlavní rubriky: Informační systémy, Mobilní technologie, Datová centra, Sítě, IT bezpečnost, Software, Hardware, Zkušenosti a názory, Speciály

Pozoruhodné IT produkty 2024
E-knihy o IT zdarma
Manuál Linux
[Linux manuál]

ecvt, fcvt: převést číslo s pohyblivou řádovou čárkou na řetězec

Originální popis anglicky: ecvt, fcvt - convert a floating-point number to a string

Návod, kniha: Linux Programmer's Manual

STRUČNĚ

#include <stdlib.h>
 
char *ecvt(double number, int ndigits, int *decpt, int *sign);
 
char *fcvt(double number, int ndigits, int *decpt, int *sign);

POPIS / INSTRUKCE

The ecvt() function converts number to a null-terminated string of ndigits digits (where ndigits is reduced to an system-specific limit determined by the precision of a double), and returns a pointer to the string. The high-order digit is nonzero, unless number is zero. The low order digit is rounded. The string itself does not contain a decimal point; however, the position of the decimal point relative to the start of the string is stored in * decpt. A negative value for *decpt means that the decimal point is to the left of the start of the string. If the sign of number is negative, * sign is set to a non-zero value, otherwise it's set to 0. If number is zero, it is unspecified whether * decpt is 0 or 1.
The fcvt() function is identical to ecvt(), except that ndigits specifies the number of digits after the decimal point.

NÁVRATOVÁ HODNOTA

Both the ecvt() and fcvt() functions return a pointer to a static string containing the ASCII representation of number. The static string is overwritten by each call to ecvt() or fcvt().

NOTES

These functions are obsolete. Instead, sprintf() is recommended. Linux libc4 and libc5 specified the type of ndigits as size_t. Not all locales use a point as the radix character (`decimal point').

ODPOVÍDAJÍCÍ

SysVR2, XPG2

SOUVISEJÍCÍ

ecvt_r(3), gcvt(3), qecvt(3), setlocale(3), sprintf(3)
1999-06-25
©2011-2024 BusinessIT.cz, ISSN 1805-0522 | Názvy použité v textech mohou být ochrannými známkami příslušných vlastníků.
Provozovatel: Bispiral, s.r.o., kontakt: BusinessIT(at)Bispiral.com | Inzerce: Best Online Media, s.r.o., zuzana@online-media.cz
O vydavateli | Pravidla webu BusinessIT.cz a ochrana soukromí | Používáme účetní program Money S3 | pg(8794)