HP OpenVMS Systems Documentation

Content starts here HP C

HP C
Run-Time Library Reference Manual for OpenVMS Systems


Previous Contents Index


isdigit

Indicates if a character is classed as a digit in the program's current locale.

Format

#include <ctype.h>

int isdigit (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a decimal digit.
0 If not a decimal digit.

isgraph

Indicates if a character is classed as a graphic character in the program's current locale.

Format

#include <ctype.h>

int isgraph (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a graphic character.
0 If not a graphic character.

islower

Indicates if a character is classed as a lowercase character in the program's current locale.

Format

#include <ctype.h>

int islower (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a lowercase alphabetic character.
0 If not a lowercase alphabetic character.

isnan (ALPHA ONLY)

Tests for a NaN. Returns 1 if the argument is NaN; 0 if not.

Format

#include <math.h>

int isnan (double x);

int isnanf (float x);

int isnanl (long double x);


Argument

x

A real value.

Description

The isnan functions return the integer value 1 (TRUE) if x is NaN (the IEEE floating point reserved not-a-number value); otherwise, they return the value 0 (FALSE).

isprint

Indicates if a character is classed as a printing character in the program's current locale.

Format

#include <ctype.h>

int isprint (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a printing character.
0 If not a printing character.

ispunct

Indicates if a character is classed as a punctuation character in the program's current locale.

Format

#include <ctype.h>

int ispunct (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a punctuation character.
0 If not a punctuation character.

isspace

Indicates if a character is classed as white space in the program's current locale; that is, if it is an ASCII space, tab (horizontal or vertical), carriage-return, form-feed, or new-line character.

Format

#include <ctype.h>

int isspace (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a white-space character.
0 If not a white-space character.

isupper

Indicates if a character is classed as an uppercase character in the program's current locale.

Format

#include <ctype.h>

int isupper (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If an uppercase alphabetic character.
0 If not an uppercase alphabetic character.

iswalnum

Indicates if a wide character is classed either as alphabetic or as a digit in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswalnum (wint_t wc);


Argument

wc

An object of type wint_t . The value of character must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If alphanumeric.
0 If not alphanumeric.

iswalpha

Indicates if a wide character is classed as an alphabetic character in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswalpha (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If alphabetic.
0 If not alphabetic.

iswcntrl

Indicates if a wide character is classed as a control character in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswcntrl (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a control character.
0 If not a control character.

iswctype

Indicates if a wide character has a specified property.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswctype (wint_t wc, wctype_t wc_prop);


Arguments

wc

An object of type wint_t . The value of wc must be representable as a valid wide-character code in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

wc_prop

A valid property name in the current locale. This is set up by calling the wctype function.

Description

The iswctype function tests whether wc has the character-class property wc_prop. Set wc_prop by calling the wctype function.

See also wctype .


Return Values

nonzero If the character has the property wc_prop.
0 If the character does not have the property wc_prop.

Example


#include <locale.h>
#include <wchar.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

/* This test will set up the "upper" character class using      */
/* wctype() and then verify whether the characters 'a' and 'A'  */
/* are members of this class                                    */

#include <stdlib.h>

main()
{

    wchar_t w_char1,
            w_char2;
    wctype_t ret_val;

    char *char1 = "a";
    char *char2 = "A";

    ret_val = wctype("upper");

    /* Convert char1 to wide-character format - w_char1 */

    if (mbtowc(&w_char1, char1, 1) == -1) {
       perror("mbtowc");
        exit(EXIT_FAILURE);
    }

    if (iswctype((wint_t) w_char1, ret_val))
        printf("[%C] is a member of the character class upper\n",
                w_char1);
    else
     printf("[%C] is not a member of the character class upper\n",
              w_char1);

    /* Convert char2 to wide-character format - w_char2 */

    if (mbtowc(&w_char2, char2, 1) == -1) {
        perror("mbtowc");
        exit(EXIT_FAILURE);
    }

    if (iswctype((wint_t) w_char2, ret_val))
        printf("[%C] is a member of the character class upper\n",
                w_char2);
    else
     printf("[%C] is not a member of the character class upper\n",
                w_char2);
}

Running the example program produces the following result:


[a] is not a member of the character class upper
[A] is a member of the character class upper

iswdigit

Indicates if a wide character is classed as a digit in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswdigit (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a decimal digit.
0 If not a decimal digit.

iswgraph

Indicates if a wide character is classed as a graphic character in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswgraph (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a graphic character.
0 If not a graphic character.

iswlower

Indicates if a wide character is classed as a lowercase character in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswlower (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a lowercase character.
0 If not a lowercase character.

iswprint

Indicates if a wide character is classed as a printing character in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswprint (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a printing character.
0 If not a printing character.

iswpunct

Indicates if a wide character is classed as a punctuation character in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswpunct (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a punctuation character.
0 If not a punctuation character.

iswspace

Indicates if a wide character is classed as a space character in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswspace (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a white-space character.
0 If not a white-space character.

iswupper

Indicates if a wide character is classed as an uppercase character in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswupper (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If an uppercase character.
0 If not an uppercase character.

iswxdigit

Indicates if a wide character is a hexadecimal digit (0 to 9, A to F, or a to f) in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswxdigit (wint_t wc);


Argument

wc

An object of type wint_t . The value of wc must be representable as a wchar_t in the current locale, or must equal the value of the macro WEOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a hexadecimal digit.
0 If not a hexadecimal digit.

isxdigit

Indicates if a character is a hexadecimal digit (0 to 9, A to F, or a to f) in the program's current locale.

Format

#include <ctype.h>

int isxdigit (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char in the current locale, or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a hexadecimal digit.
0 If not a hexadecimal digit.

j0, j1, jn (ALPHA ONLY)

Compute Bessel functions of the first kind.

Format

#include <math.h>

double j0 (double x);

float j0f (float x);

long double j0l (long double x);

double j1 (double x);

float j1f (float x);

long double j1l (long double x);

double jn (int n, double x);

float jnf (int n, float x);

long double jnl (int n, long double x);


Arguments

x

A real value.

n

An integer.

Description

The j0 functions return the value of the Bessel function of the first kind of order 0.

The j1 functions return the value of the Bessel function of the first kind of order 1.

The jn functions return the value of the Bessel function of the first kind of order n.

The j1 and jn functions can result in an underflow as x gets small. The largest value of x for which this occurs is a function of n.


Return Values

x The relevant Bessel value of x of the first kind.
0 The value of the x argument is too large, or underflow occurred; errno is set to ERANGE.
NaN x is NaN; errno is set to EDOM.


Previous Next Contents Index