🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #1501

Re: Printf: vaste lengte strings en ints?

#1501
From: Sjoerd A. Schreuder
Date: Wed, 02 Mar 2005 17:59
27 lines
2068 bytes
Dr.Ruud wrote:
[knip]
> Voor een signed int van 8 bits heb je 4 posities nodig,
> 16 bits: 6 posities
> 32 bits: 11 posities
> 64 bits: 20 posities
> 96 bits: 30 posities
> 128 bits: 40 posities
> en dan steeds per 32 bits er 9 of 10 posities bij.
> 
> bits = 8*sizeof(int)

Iets correcter is:
   bits = CHAR_BITS * sizeof(int)
Al zal de aanname dat CHAR_BITS == 8 niet zoveel platforms
uitsluiten.

Misschien dat ooit er een compiler komt waarbij CHAR_BITS==32,
maar er is zoveel code afhankelijk van de aanname dat CHAR_BITS==8
dat ik niet verwacht dat zo'n compiler ooit commercieel succesvol
zal zijn.

Dus deze bijdrage is vooral van theoretisch belang.

[knip: afleiding leuke formules]

Sjoerd
Technical Details
Message-ID: <4225ff1c$0$70620$dbd41001@news.wanadoo.nl>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news2.euro.net!postnews2.euro.net!news.wanadoo.nl!not-for-mail
References: <M5qdnYvpZutbs7nfRVnyjA@scarlet.biz> <d01i4u.14c.1@news.isolution.nl> <CqudnXnc_MjnCbjfRVnyhg@casema.nl> <d050po.130.1@news.isolution.nl>

Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,f962124bbb04ff22
X-Google-Thread: 107324,f962124bbb04ff22
X-Google-Attributes: gidfcea4,gid107324,public
X-Google-Language: DUTCH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news2.euro.net!postnews2.euro.net!news.wanadoo.nl!not-for-mail
Date: Wed, 02 Mar 2005 18:59:57 +0100
From: "Sjoerd A. Schreuder" <sa_schreuder@wanadoo.nl>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: be.comp.programming,nl.comp.programmeren
Subject: Re: Printf: vaste lengte strings en ints?
References: <M5qdnYvpZutbs7nfRVnyjA@scarlet.biz> <d01i4u.14c.1@news.isolution.nl> <CqudnXnc_MjnCbjfRVnyhg@casema.nl> <d050po.130.1@news.isolution.nl>
In-Reply-To: <d050po.130.1@news.isolution.nl>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 28
Message-ID: <4225ff1c$0$70620$dbd41001@news.wanadoo.nl>
Organization: Wanadoo
NNTP-Posting-Date: 02 Mar 2005 17:59:56 GMT
NNTP-Posting-Host: c3eea429e.cable.wanadoo.nl
X-Trace: 1109786396 dr3.euro.net 70620 62.234.66.158:1661
X-Complaints-To: abuse@wanadoo.nl