473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

isodigit

The standard defines isdigit and isxdigit but doesn't say anything
about isodigit (testing for octal digits).
Anyone knows why?
Thanks.
Joey.
Nov 19 '07 #1
10 2931
JoseMariaSola <Jo***********@gmail.comwrote:
The standard defines isdigit and isxdigit but doesn't say anything
about isodigit (testing for octal digits).
Anyone knows why?
No, but it's simple to define, since the Standard does demand that '0'
through '7' are subsequent.

Richard
Nov 19 '07 #2
The standard defines isdigit and isxdigit but doesn't say
anything about isodigit (testing for octal digits).
Anyone knows why?
No, but it's simple to define, since the Standard
does demand that '0'through '7' are subsequent.
Then it's also simple to define isdigit, but the standard defines it
and doesn't leave the definition to us.
Why isn't that the case with isodigit?

Nov 19 '07 #3
JoseMariaSola wrote:
>>The standard defines isdigit and isxdigit but doesn't say
anything about isodigit (testing for octal digits).
Anyone knows why?
No, but it's simple to define, since the Standard
does demand that '0'through '7' are subsequent.
Then it's also simple to define isdigit, but the standard defines it
and doesn't leave the definition to us.
Why isn't that the case with isodigit?
No one thought of it? You could try asking on comp.std.c

As Richard said, it is trivial to define.

--
Ian Collins.
Nov 19 '07 #4
On Nov 19, 2:24 pm, JoseMariaSola <JoseMariaS...@gmail.comwrote:
The standard defines isdigit and isxdigit but doesn't say
anything about isodigit (testing for octal digits).
Anyone knows why?
No, but it's simple to define, since the Standard
does demand that '0'through '7' are subsequent.

Then it's also simple to define isdigit, but the standard defines it
and doesn't leave the definition to us.
Why isn't that the case with isodigit?

I suspect there are two reasons. One a lack of interest, especially
given how trivial it would be implement yourself (really? you
actually have some a purpose for isodigit?). Second, adding another
ctype class would probably require a bigger lookup table (assuming the
typical design) on many small C implementations, for darn little good
reason. If you have eight bit chars, and can live with some
restrictions* on what different locales can do to the ctype classes,
you can implement everything (except toupper/lower) with a single 256
(usually 257) byte table. Add another class, and you either need 256
shorts, or a second table.
*Specifically, you have to disallow locales that have characters in
isalpha that are not in islower or isupper, or with characters in
isspace that are not in isprint or iscntrl. Which are actually a
common conditions for compilers targeting small embedded systems,
which often restrict themselves to just the C locale.
Nov 20 '07 #5
In article
<38**********************************@s12g2000prg. googlegroups.com>,
JoseMariaSola <Jo***********@gmail.comwrote on Tuesday 20 Nov 2007
1:54 am:
The standard defines isdigit and isxdigit but doesn't say
anything about isodigit (testing for octal digits).
Anyone knows why?
No, but it's simple to define, since the Standard
does demand that '0'through '7' are subsequent.
Then it's also simple to define isdigit, but the standard defines it
and doesn't leave the definition to us.
Why isn't that the case with isodigit?
It's trivial to implement isodigit() in terms of isdigit().

Nov 20 '07 #6
JoseMariaSola wrote:
>
>>The standard defines isdigit and isxdigit but doesn't say
anything about isodigit (testing for octal digits).
Anyone knows why?

No, but it's simple to define, since the Standard
does demand that '0'through '7' are subsequent.

Then it's also simple to define isdigit, but the standard
defines it and doesn't leave the definition to us. Why isn't
that the case with isodigit?
I don't know. Why doesn't the standard library contain a routine
to flim my diddle? I suspect the answer is the same.

--
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
Try the download section.
--
Posted via a free Usenet account from http://www.teranews.com

Nov 20 '07 #7
CBFalconer wrote:
JoseMariaSola wrote:
>>>The standard defines isdigit and isxdigit but doesn't say
anything about isodigit (testing for octal digits).
Anyone knows why?
No, but it's simple to define, since the Standard
does demand that '0'through '7' are subsequent.
Then it's also simple to define isdigit, but the standard
defines it and doesn't leave the definition to us. Why isn't
that the case with isodigit?

I don't know. Why doesn't the standard library contain a routine
to flim my diddle? I suspect the answer is the same.
Because they didn't know what octal numbers are?
Nov 20 '07 #8
JoseMariaSola wrote:
The standard defines isdigit and isxdigit but doesn't say
anything about isodigit (testing for octal digits).
Anyone knows why?
No, but it's simple to define, since the Standard
does demand that '0'through '7' are subsequent.
Then it's also simple to define isdigit, but the standard defines it
and doesn't leave the definition to us.
Why isn't that the case with isodigit?
I /guess/ that when C was standardised, `isdigit` and `isxdigit` were in
widespread use, but `isodigit` (which I can't help but read as `iso-digit`)
wasn't.

History: things that happened that leave traces in the present.

--
Chris "don't worry, coffee will fix it" Dollin

Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN

Nov 20 '07 #9
santosh wrote:
>
In article
<38**********************************@s12g2000prg. googlegroups.com>,
JoseMariaSola <Jo***********@gmail.comwrote on Tuesday 20 Nov 2007
1:54 am:
The standard defines isdigit and isxdigit but doesn't say
anything about isodigit (testing for octal digits).
Anyone knows why?
No, but it's simple to define, since the Standard
does demand that '0'through '7' are subsequent.
Then it's also simple to define isdigit, but the standard defines it
and doesn't leave the definition to us.
Why isn't that the case with isodigit?

It's trivial to implement isodigit() in terms of isdigit().
#include <ctype.h>

int is_odigit(int c)
{
return isdigit(c) && '8' c;
}

--
pete
Nov 20 '07 #10
In article <fh**********@tadcaster.hpl.hp.com>,
Chris Dollin <ch**********@hp.comwrote:
>I /guess/ that when C was standardised, `isdigit` and `isxdigit` were in
widespread use, but `isodigit` (which I can't help but read as `iso-digit`)
wasn't.
It may be relevant that in early C, the digits 8 and 9 were allowed in
octal constants.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Nov 20 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

185
by: jacob navia | last post by:
Hi We are rewriting the libc for the 64 bit version of lcc-win and we have added a new field in the FILE structure: char *FileName; fopen() will save the file name and an accessor function will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.