Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] issues with format of double (or IEEE754)
- Date: Thu, 27 Jul 2006 01:30:08 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: Re: [tlug] issues with format of double (or IEEE754)
- References: <20060726125907.GH5111@example.com>
- Organization: The XEmacs Project
- User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.5-b27 (linux)
>>>>> "Michal" == Michal Hajek <hajek1@example.com> writes: Michal> char result_normal_plus[17]="00000000000000000"; Initialize this to a number whose IEEE 754 representation you know, then print it without reading from the device. That will tell you whether doubles in memory are IEEE 754 doubles. Michal> presult= result_normal_plus+2; Have you tried result_normal_plus[2] = '\0'; printf ("header = '%s'\n", result_normal_plus); yet to make sure the alignment is what you expect, and the device is producing the header properly? Michal> where presult is a pointer to double, eg. defined as: Michal> double *presult; Michal> The problem is that if I print the number: Michal> printf("*presult: %.12f \n",*presult); Well, if you're not getting bus errors, I guess alignment doesn't matter. This kind of casting is normally an excellent way to get into real trouble, though. Michal> Or maybe suggest a more clever [3] way of getting the Michal> result from nanovoltmeter? If you believe the documentation, you should just compute the number yourself either using atof or a direct computation (do you really think the nanovoltmeter gives you more than 32 bits of accuracy?) -- School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.
- Follow-Ups:
- References:
- [tlug] issues with format of double (or IEEE754)
- From: Michal Hajek
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] I'm a glutton for punishment - Palm Pilot and Ubuntu Dapper LTS connectivity
- Next by Date: Re: [tlug] issues with format of double (or IEEE754)
- Previous by thread: Re: [tlug] Internal floating point formats used by 80387, IEEE 754 and C . . . . .
- Next by thread: [tlug] result_normal_plus[2]='\0' likely clobbers payload (was Re: issues with format of double (or IEEE754))
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links