Newsgroups: fj.lang.c
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!etlnews.etl.go.jp!etlinn.etl.go.jp!etl.go.jp!trc.rwcp!rwc-tyo!news.iij.ad.jp!tuucp1.space.ad.jp!nuucp1.space.ad.jp!ouucp1.space.ad.jp!news.momiji.or.jp!news.hek.co.jp!news.csi.ad.jp!hiroshima-u!toksen!tokujo!yamaguchi!hakata!kudpc!sakunami!ayashi!kaneko
From: kaneko@ccedu.sendai-ct.ac.jp (Yutaka Kaneko)
Subject: Re: how to get highest bit
X-Nntp-Posting-Host: saikachi
Message-ID: <Dv1tJ2.px@ayashi.cc.sendai-ct.ac.jp>
Lines: 28
Sender: news@ayashi.cc.sendai-ct.ac.jp (SNCT NetNews Manager)
Organization: Sendai National College of Technology
X-Newsreader: mnews [version 1.18PL3] 1994-08/01(Mon)
References: <31F600CE.3981@Jsn.justnet.or.jp>
Date: Wed, 24 Jul 1996 13:01:49 GMT
Xref: galaxy.trc.rwcp.or.jp fj.lang.c:2640
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.lang.c&nb=2640&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

  $B6b;R!w@gBfEEGH$G$9!#(B

In article <31F600CE.3981@Jsn.justnet.or.jp>
Nobuhide_Tsuda@Jsn.justnet.or.jp writes:
>> $B$3$s$K$A$O!"DEED$H$b$&$7$^$9!#(B 
>>  
>> $B@0?t$NCM$rJ];}$9$kJQ?t$,$"$k!J$?$H$($P(B unsigned int$B!K!#(B $B$3$NJQ?t$KF~$C$F(B 
>> $B$$$kCM$r#2?J?t$GI=8=$7$?$H$-$K!"%S%C%H$,#1$G:G$b:8$K$"$k%S%C%H$@$1$r#1$K$7!"(B 
>> $B$=$NB>$N%S%C%H$O#0$K$7$?$$!J$?$@$7!"JQ?t$NCM$O#0$G$O$J$$$H$9$k!K!#(B 

  unsigined int x;
  y = 1 << ((int)(log2((double)x)));

$B$C$F$N$OH?B'$G$9$+$M!)(B

  log2()$B$N$J$$=hM}7O$G$7$?$i!"(B

  #define log2(x) (log(x)/log(2.0))

$B$"$?$j$GBeMQ$7$F$/$@$5$$!#(B

  $BB?J,!"$b$C$H9bB.$JJ}K!$,$"$k$G$7$g$&!#(B

main(i,j){j=time(0);do for(i /*      $B6b;R(B $BM5(B(KANEKO Yutaka)             */
=0;i<79;i++)printf(j%512>>4? /* Sendai National College of Technology   */
" ":"*"),j=j*331+113;while(  /*    kaneko@cc.sendai-ct.ac.jp            */
printf("\n\033[H\033[1L"));} /* $B6d;HEL(Bx10 $B6b;HEL(Bx0 $B6d%-%g%m(Bx0 $B6b%-%g%m(Bx1*/
$BK\(BMessage$B$X$N%U%)%m!<!"JV?.$GFC$KCG$j$N$J$$$b$N$OL5CG0zMQ$9$k>l9g$,$"$j$^$9!#(B
