Article View: comp.std.c
Article #3819Re: Why "long long" doesn't work.
From: FFarance
Date: Tue, 22 Aug 1995 15:04
Date: Tue, 22 Aug 1995 15:04
61 lines
2224 bytes
2224 bytes
> How does the proposal deal with related language issues such as typing
integer
> constants and support for these types in library functions, most notably
> *printf, *scanf, ato*, strto*?
The proposal:
ftp://ftp.dmk.com/DMK/sc22wg14/c9x/extended-integers/sbeir.*
describes these extensions. In summary:
The "printf" and "scanf" funcitons are extended via the "?" type modifier.
For example:
printf("%?d",precof(x),x);
will always work. Think of "?" as a combination of "*" (takes the next
argument) and "l" and "h" (the type modifiers). I you really want to
get wild:
printf("%*?d",field_width,precof(x),x);
The "precof()" operator returns a "prec_t" which extracts the precision
information (and other SBEIR information) from the operand. The "scanf"
function is extended similarly.
The "ato*" functions aren't extended in SBEIR.
The "strto*" functions now have "strtoint()":
void strtoint
(
const char *nptr,
char **endptr,
int base,
void *buf,
prec_t type
);
The proposal requires compilers to support up to 128-bit integer
constants. The following notation will be added to the next
revision:
ddddddPnn
The constant "ddddd" has precision "nn" (the number of bits). For
example:
1234567P32
would be a 32-bit constant. You should read the proposal anyway to
understand the rationale behind the feature. Many questions people
pose about SBEIR could be answered (in more detail) by reading the
proposal.
-FF
-------------------------------------------------------------------
(``I only use AOL for reading netnews.'')
Frank Farance, Farance Inc.
E-mail: frank@farance.com, Telephone: +1 212 486 4700
ISO JTC1/SC22/WG14 & ANSI X3J11 (C Programming Language) Project Editor
Technical Details
Message-ID:
<41crmm$o3u@newsbf02.news.aol.com>Path:
arc1-ca.pugleaf.net!newsbf02.news.aol.com!not-for-mailReferences:
<808962429snz@genesis.demon.co.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!newsbf02.news.aol.com!not-for-mail From: ffarance@aol.com (FFarance) Newsgroups: comp.std.c Subject: Re: Why "long long" doesn't work. Date: 22 Aug 1995 11:04:54 -0400 Organization: America Online, Inc. (1-800-827-6364) Sender: root@newsbf02.news.aol.com Message-ID: <41crmm$o3u@newsbf02.news.aol.com> References: <808962429snz@genesis.demon.co.uk> Reply-To: ffarance@aol.com (FFarance) NNTP-Posting-Host: newsbf02.mail.aol.com