Newsgroups: fj.lang.c
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!newsgate1.web.ad.jp!news.fukuoka.infoweb.or.jp!newshost.ryukyu.ad.jp!sour!merope!void
From: void@merope.opus.or.jp (Kusakabe Youichi)
Subject: Re: about read binary file.
Message-ID: <1997May2.082656.6273@merope.opus.or.jp>
Organization: Macintosh User Group PLEIADES in opus
X-Newsreader: TIN [version 1.2 PL0]
References: <HISATOMI.97Apr21132126@seigyo.cc.saga-u.ac.jp> <HISATOMI.97May1155732@seigyo.cc.saga-u.ac.jp>
Date: Fri, 2 May 1997 08:26:56 GMT
Lines: 28
Xref: galaxy.trc.rwcp.or.jp fj.lang.c:4049
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.lang.c&nb=4049&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.

hisatomi@cc.saga-u.ac.jp wrote:
: $BIT6q9g$H$7$F$O(B printf("%8x\n",a.dwords); $B$G(B
: $B2<0L(Bbytes$B$N(B0000$B$N$_I=<($5$l$F$$$?$N$G!"$&$^$/F0:n$7$J$$$H;W$$$^$7$?!#(B
: $B$,!"A02sBg5WJ]$5$s$N(Bsample program $B$N%G!<%?$G3NG'$7$F$_$k$H!"(B
: printf("%8x\n",a.dwords); $B$NJ,$O2<0L(Bbytes$B$7$+I=<($5$l$J$+$C$?$N$G$9$,!"(B
: printf("%f\n",a.fwords); $B$OBg5WJ]$5$s$N=PNO7k2L$H9gCW$7$^$7$?!#(B

#include <stdio.h>
main()
{
union {
long dwords;
float fwords;
} a;

a.dwords = 0x3f800000;
printf("%8x\n", a.dwords);
printf("%f\n", a.fwords);
return;
}
$B$r<B9T$7$F$_$^$7$?$,!"(B
3f800000
1.000000
$B$K$J$j$^$7$?$h(B?
  $B%X(B_$B%X(B   ------------------------
$B%_!&!&(B $B%_(B  void@merope.opus.or.jp
 (  $B!k(B )$B!A(B            $BF|2<ItM[0l(B
----------------------------------
