Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ atoi(3) — AOS 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

scanf(3S)

ATOF(3)  —  

NAME

atof, atoi, atol − convert ASCII to numbers

SYNOPSIS

double atof(nptr)
char ∗nptr;

atoi(nptr)
char ∗nptr;

long atol(nptr)
char ∗nptr;

DESCRIPTION

These functions convert a string pointed to by nptr to IEEE double, to integer, and to long integer representation, respectively.  The first unrecognized character ends the string. 

Atof recognizes an optional string of spaces, then an optional sign, then a string of digits optionally containing a decimal point, and then an optional “e” or “E” followed by an optionally signed integer.  Conversion is rounded, with a worst-case error of 0.513 ulps (units in the last place).  Values less than 2.225e-308 in magnitude have denormal representation.  Values greater than 1.7976931348623158e308 in magnitude are represented by a signed infinity.  Atof also accepts the strings “INF” and “NAN()”, ignoring case. 

Atoi and atol recognize an optional string of spaces, then an optional sign, and then a string of digits. 

SEE ALSO

scanf(3S)

PRPQs 5799-WZQ/5799-PFF: IBM/4.3  —  30 Sep 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026