*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> wcstold (3)              
Title
Content
Arch
Section
 

wcstold(3)

Contents


NAME    [Toc]    [Back]

       wcstold  -  Convert a wide-character string to a long double-precision
 value

SYNOPSIS    [Toc]    [Back]

       #include <wchar.h>

       long double wcstold(
               const wchar_t *ws,
               wchar_t **endptr );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

STANDARDS    [Toc]    [Back]

       Interfaces documented on this reference  page  conform  to
       industry standards as follows:

       wcstold(): ISO C

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Points to the wide-character string to be converted  to  a
       long  double-precision  floating-point value.  Points to a
       pointer in which the wcstold() function stores  the  position
  of  the  final wide-character segment of the string,
       which contains unrecognized characters and the null terminator.

DESCRIPTION    [Toc]    [Back]

       The wcstold() function converts the initial portion of the
       wide-character string pointed to by the ws parameter to  a
       long  double-precision  floating-point  value.  The  input
       wide-character string is  first  broken  down  into  three
       parts: an initial (possibly empty) sequence of white-space
       wide-character codes (as specified by the iswspace() function);
  a subject sequence interpreted as a floating-point
       constant; and a final wide-character string of one or more
       unrecognized wide-character codes, including the terminating
 null wide character. The subject sequence is then  (if
       possible)   converted   to  a  floating-point  number  and
       returned as the result of the wcstold() function.

       The subject sequence is expected to consist of an optional
       +  (plus  sign)  or - (minus sign), a nonempty sequence of
       digits (which may  contain  a  radix  character),  and  an
       optional  exponent.  The exponent consists of e or E, followed
 by an optional sign, followed by one or more decimal
       digits. The subject sequence is the longest initial subsequence
 of the input wide-character string  (starting  with
       the  first  nonwhite-space wide-character code) that is of
       the expected form. The subject sequence contains no  widecharacter
  codes  if  the  input  wide-character string is
       empty or consists entirely of  white-space  wide-character
       codes,  or if the first nonwhite-space wide-character code
       is other than a sign, a digit, or a radix character.

       If the subject sequence is valid, the  sequence  of  widecharacter
  codes,  starting  with the first digit or radix
       character (whichever occurs first), is  interpreted  as  a
       floating-point  or  double-precision  floating-point  constant.
  The locale's radix character is treated as equivalent
  to the . (period) within floating-point constants in
       the C locale. If neither an exponent  or  radix  character
       appears,  a  radix character is assumed to follow the last
       digit  in  the  wide-character  string.  If  the   subject
       sequence  begins  with  -  ( a minus sign), the conversion
       value is negated. The radix character is determined by the
       LC_NUMERIC  category  in the program's current locale.  In
       the C locale, or in a locale where the radix character  is
       not defined, the radix character is a . (period).

       The wcstold() function stores a pointer to the final widecharacter
 segment of the string (starting with  the  first
       invalid  character) in the object pointed to by the endptr
       parameter, unless the endptr parameter is a null  pointer.

RETURN VALUES    [Toc]    [Back]

       The  wcstold()  function  returns the converted value of a
       long double-precision  floating-point  value  if  a  valid
       floating-point  constant  is found. If the converted value
       is outside the range of representable values  (either  too
       high  or  too  low),  the  function  returns plus or minus
       HUGE_VAL and sets errno  to  [ERANGE].  If  the  converted
       value would cause underflow, the function returns 0 (zero)
       and sets errno to [ERANGE]. If  the  subject  sequence  is
       empty  or  does  not  have the expected form, the function
       performs no conversion and  returns  0  (zero).   In  this
       case, the value specified by the ws parameter is stored in
       the object pointed to by the  endptr  parameter,  provided
       that the endptr parameter is not a null pointer.

       Since  the wcstold() function returns 0 (zero) or HUGE_VAL
       in the event of an error and these values are  also  valid
       returns  if the wcstold() function is successful, applications
 should set errno to 0 (zero) before each call to the
       wcstold()  function and check errno after each return from
       the function. If errno is nonzero after a return, an error
       occurred.  Additionally, if 0 (zero) is returned, applications
 should check if the endptr parameter equals the nptr
       parameter.  In  this  case,  there  was  no  valid subject
       string.

ERRORS    [Toc]    [Back]

       If the following condition occurs, the wcstold()  function
       sets errno to the corresponding value: The converted value
       would cause underflow or, if outside the range  of  representable
 values, overflow.

SEE ALSO    [Toc]    [Back]

      
      
       Functions:  atof(3), iswspace(3), localeconv(3), scanf(3),
       setlocale(3), wcstod(3), wcstol(3)

       Standards: standards(5)



                                                       wcstold(3)
[ Back ]
 Similar pages
Name OS Title
wcstod Tru64 Convert a wide-character string to a double-precision value
wcstod IRIX convert wide-character string to double-precision number
wcstoll FreeBSD convert a wide character string value to a long, unsigned long, long long, unsigned long long, intma...
wcstoumax FreeBSD convert a wide character string value to a long, unsigned long, long long, unsigned long long, intma...
wcstoimax FreeBSD convert a wide character string value to a long, unsigned long, long long, unsigned long long, intma...
wcstoull FreeBSD convert a wide character string value to a long, unsigned long, long long, unsigned long long, intma...
wcstoul FreeBSD convert a wide character string value to a long, unsigned long, long long, unsigned long long, intma...
wcstol FreeBSD convert a wide character string value to a long, unsigned long, long long, unsigned long long, intma...
wcstol Tru64 Convert a wide-character string to long integer
wcstod FreeBSD convert string to float, double or long double
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service