view docs/ccguide/atof.refentry @ 1381:98bbecab8089

Slight fix
author boisy
date Tue, 30 Sep 2003 01:58:43 +0000
parents 1f4a17c1c56d
children
line wrap: on
line source

<refentry id="atof">
<refnamediv>
<refname>Atof</refname>
<refname>Atoi</refname>
<refname>Atol</refname>
<refpurpose>ASCII to number conversions</refpurpose>
</refnamediv>

<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
  <funcdef>double <function>atof</function></funcdef>
  <paramdef>char *<parameter>ptr</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>long <function>atol</function></funcdef>
  <paramdef>char *<parameter>ptr</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>int <function>atoi</function></funcdef>
  <paramdef>char *<parameter>ptr</parameter></paramdef>
</funcprototype>
</funcsynopsis>

</refsynopsisdiv>

<refsect1><title>Description</title>
<para>
Conversions of the string pointed to by "ptr" to the relevant
number type are carried out by these functions. They cease to
convert a number when the first unrecognized character is
encountered.
</para>
<para>
Each skips leading spaces and tab characters. Atof()
recognizes an optional sign followed by a digit string that
could possibly contain a decimal point, then an optional "e"
or "E", and optional sign and a digit string. Atol() and atoi()
recognize an optional sign and a digit string.
</para>
</refsect1>
<refsect1><title>Caveats</title>
<para>
Overflow causes unpredictable results. There are no error
indications.
</para>
</refsect1>
</refentry>