Стандарт языка Си С99 TC (1113411), страница 37
Текст из файла (страница 37)
If z has an infinite part, then cproj(z) isequivalent toINFINITY + I * copysign(0.0, cimag(z))Returns3The cproj functions return the value of the projection onto the Riemann sphere.170) For a variable z of complex type, z == creal(z) + cimag(z)*I.§7.3.9.4Library179ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.3.9.5 The creal functionsSynopsis1#include <complex.h>double creal(double complex z);float crealf(float complex z);long double creall(long double complex z);Description2The creal functions compute the real part of z.171)Returns3The creal functions return the real part value.171) For a variable z of complex type, z == creal(z) + cimag(z)*I.180Library§7.3.9.5WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.4 Character handling <ctype.h>1The header <ctype.h> declares several functions useful for classifying and mappingcharacters.172) In all cases the argument is an int, the value of which shall berepresentable as an unsigned char or shall equal the value of the macro EOF.
If theargument has any other value, the behavior is undefined.2The behavior of these functions is affected by the current locale. Those functions thathave locale-specific aspects only when not in the "C" locale are noted below.3The term printing character refers to a member of a locale-specific set of characters, eachof which occupies one printing position on a display device; the term control characterrefers to a member of a locale-specific set of characters that are not printingcharacters.173) All letters and digits are printing characters.Forward references: EOF (7.19.1), localization (7.11).7.4.1 Character classification functions1The functions in this subclause return nonzero (true) if and only if the value of theargument c conforms to that in the description of the function.7.4.1.1 The isalnum functionSynopsis1#include <ctype.h>int isalnum(int c);Description2The isalnum function tests for any character for which isalpha or isdigit is true.7.4.1.2 The isalpha functionSynopsis1#include <ctype.h>int isalpha(int c);Description2The isalpha function tests for any character for which isupper or islower is true,or any character that is one of a locale-specific set of alphabetic characters for which172) See ‘‘future library directions’’ (7.26.2).173) In an implementation that uses the seven-bit US ASCII character set, the printing characters are thosewhose values lie from 0x20 (space) through 0x7E (tilde); the control characters are those whosevalues lie from 0 (NUL) through 0x1F (US), and the character 0x7F (DEL).§7.4.1.2Library181ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256none of iscntrl, isdigit, ispunct, or isspace is true.174) In the "C" locale,isalpha returns true only for the characters for which isupper or islower is true.7.4.1.3 The isblank functionSynopsis1#include <ctype.h>int isblank(int c);Description2The isblank function tests for any character that is a standard blank character or is oneof a locale-specific set of characters for which isspace is true and that is used toseparate words within a line of text.
The standard blank characters are the following:space (' '), and horizontal tab ('\t'). In the "C" locale, isblank returns true onlyfor the standard blank characters.7.4.1.4 The iscntrl functionSynopsis1#include <ctype.h>int iscntrl(int c);Description2The iscntrl function tests for any control character.7.4.1.5 The isdigit functionSynopsis1#include <ctype.h>int isdigit(int c);Description2The isdigit function tests for any decimal-digit character (as defined in 5.2.1).7.4.1.6 The isgraph functionSynopsis1#include <ctype.h>int isgraph(int c);174) The functions islower and isupper test true or false separately for each of these additionalcharacters; all four combinations are possible.182Library§7.4.1.6WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3Description2The isgraph function tests for any printing character except space (' ').7.4.1.7 The islower functionSynopsis1#include <ctype.h>int islower(int c);Description2The islower function tests for any character that is a lowercase letter or is one of alocale-specific set of characters for which none of iscntrl, isdigit, ispunct, orisspace is true.
In the "C" locale, islower returns true only for the lowercaseletters (as defined in 5.2.1).7.4.1.8 The isprint functionSynopsis1#include <ctype.h>int isprint(int c);Description2The isprint function tests for any printing character including space (' ').7.4.1.9 The ispunct functionSynopsis1#include <ctype.h>int ispunct(int c);Description2The ispunct function tests for any printing character that is one of a locale-specific setof punctuation characters for which neither isspace nor isalnum is true. In the "C"locale, ispunct returns true for every printing character for which neither isspacenor isalnum is true.7.4.1.10 The isspace functionSynopsis1#include <ctype.h>int isspace(int c);Description2The isspace function tests for any character that is a standard white-space character oris one of a locale-specific set of characters for which isalnum is false.
The standard§7.4.1.10Library183ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256white-space characters are the following: space (' '), form feed ('\f'), new-line('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). In the"C" locale, isspace returns true only for the standard white-space characters.7.4.1.11 The isupper functionSynopsis1#include <ctype.h>int isupper(int c);Description2The isupper function tests for any character that is an uppercase letter or is one of alocale-specific set of characters for which none of iscntrl, isdigit, ispunct, orisspace is true.
In the "C" locale, isupper returns true only for the uppercaseletters (as defined in 5.2.1).7.4.1.12 The isxdigit functionSynopsis1#include <ctype.h>int isxdigit(int c);Description2The isxdigit function tests for any hexadecimal-digit character (as defined in 6.4.4.1).7.4.2 Character case mapping functions7.4.2.1 The tolower functionSynopsis1#include <ctype.h>int tolower(int c);Description2The tolower function converts an uppercase letter to a corresponding lowercase letter.Returns3If the argument is a character for which isupper is true and there are one or morecorresponding characters, as specified by the current locale, for which islower is true,the tolower function returns one of the corresponding characters (always the same onefor any given locale); otherwise, the argument is returned unchanged.184Library§7.4.2.1WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.4.2.2 The toupper functionSynopsis1#include <ctype.h>int toupper(int c);Description2The toupper function converts a lowercase letter to a corresponding uppercase letter.Returns3If the argument is a character for which islower is true and there are one or morecorresponding characters, as specified by the current locale, for which isupper is true,the toupper function returns one of the corresponding characters (always the same onefor any given locale); otherwise, the argument is returned unchanged.§7.4.2.2Library185ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.5 Errors <errno.h>1The header <errno.h> defines several macros, all relating to the reporting of errorconditions.2The macros areEDOMEILSEQERANGEwhich expand to integer constant expressions with type int, distinct positive values, andwhich are suitable for use in #if preprocessing directives; anderrnowhich expands to a modifiable lvalue175) that has type int, the value of which is set to apositive error number by several library functions.
It is unspecified whether errno is amacro or an identifier declared with external linkage. If a macro definition is suppressedin order to access an actual object, or a program defines an identifier with the nameerrno, the behavior is undefined.3The value of errno is zero at program startup, but is never set to zero by any libraryfunction.176) The value of errno may be set to nonzero by a library function callwhether or not there is an error, provided the use of errno is not documented in thedescription of the function in this International Standard.4Additional macro definitions, beginning with E and a digit or E and an uppercaseletter,177) may also be specified by the implementation.175) The macro errno need not be the identifier of an object. It might expand to a modifiable lvalueresulting from a function call (for example, *errno()).176) Thus, a program that uses errno for error checking should set it to zero before a library function call,then inspect it before a subsequent library function call.
Of course, a library function can save thevalue of errno on entry and then set it to zero, as long as the original value is restored if errno’svalue is still zero just before the return.177) See ‘‘future library directions’’ (7.26.3).186Library§7.5WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.6 Floating-point environment <fenv.h>1The header <fenv.h> declares two types and several macros and functions to provideaccess to the floating-point environment. The floating-point environment referscollectively to any floating-point status flags and control modes supported by theimplementation.178) A floating-point status flag is a system variable whose value is set(but never cleared) when a floating-point exception is raised, which occurs as a side effectof exceptional floating-point arithmetic to provide auxiliary information.179) A floatingpoint control mode is a system variable whose value may be set by the user to affect thesubsequent behavior of floating-point arithmetic.2Certain programming conventions support the intended model of use for the floatingpoint environment:180)— a function call does not alter its caller’s floating-point control modes, clear its caller’sfloating-point status flags, nor depend on the state of its caller’s floating-point statusflags unless the function is so documented;— a function call is assumed to require default floating-point control modes, unless itsdocumentation promises otherwise;— a function call is assumed to have the potential for raising floating-point exceptions,unless its documentation promises otherwise.3The typefenv_trepresents the entire floating-point environment.4The typefexcept_trepresents the floating-point status flags collectively, including any status theimplementation associates with the flags.178) This header is designed to support the floating-point exception status flags and directed-roundingcontrol modes required by IEC 60559, and other similar floating-point state information.