Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ watof(3I) — SunOS 5.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

wctype(3I)

scanf(3S)

wstod(3I)

NAME

wstod, watof − convert a Process Code string to double-precision number

SYNOPSIS

cc [ flag ... ] file ... −lw [ library ... ]

#include <widec.h>

double wstod(wchar_t ∗str, wchar_t ∗∗ptr);

double watof(wchar_t ∗str);

MT-LEVEL

MT-Safe

DESCRIPTION

wstod() returns as a double-precision floating-point number the value represented by the wchar_t string pointed to by str.

wstod recognizes a string that starts with an optional number of white characters, as defined by iswspace in wctype(3I), followed by an optional “+” or “-” symbol, then a decimal numeric string that may include a decimal point, followed by an optional “e” or “E”, with an optional “+”, “-” or space, and an integer. The characters used in this string must be ASCII characters. 

If the value of ptr is not (wchar_t ∗∗)NULL, a pointer to the character terminating the scan is returned in the location pointed to by ptr. If no number can be formed, ∗ptr is set to str, and 0.0 is returned. 

watof(str) is equivalent to wstod(str, (wchar_t ∗∗)NULL). 

RETURN VALUES

When the value overflows, +/- HUGE (as defined in <math.h> ) is returned depending on the sign, and errno is set to ERANGE. 
When the value underflows, 0 is returned and errno is set to ERANGE. 

Exponent overflow and underflow produce the results specified by the IEEE Standard.  In addition, errno is set to ERANGE. 

SEE ALSO

wctype(3I), scanf(3S)

Sun Microsystems  —  Last change: 22 Jan 1993

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