About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/isdigit.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 isdigit Context: slangrtl

Synopsis

Tests for a decimal digit character

Syntax

Integer_Type isdigit (String_Type s)

Description

This function returns a non-zero value if the first character in the string s is a digit; otherwise, it returns zero.

Example

A simple, user defined implementation of isdigit is

    define isdigit (s)
    {
       return ((s[0] <= '9') and (s[0]  >= '0'));
    }

However, the intrinsic function isdigit executes many times faster than the equivalent representation defined above.

Unlike the C function with the same name, the S-Lang function takes a string argument.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.