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: Wed, 26 Jul 2006 19:07:30 +0200
- From: Botond Botyanszki <tlug@example.com>
- Subject: Re: [tlug] issues with format of double (or IEEE754)
- References: <20060726125907.GH5111@example.com> <20060726103316.5fd3a597.jep200404@example.com> <20060726160548.GJ5111@example.com>
On Wed, 26 Jul 2006 18:05:48 +0200 Michal Hajek <hajek1@example.com> wrote: > > > char result_normal_plus[17]="00000000000000000"; > > > > If that is global, keep in mind that result_normal_plus will > > initialized only _once_. > > yes, thank you for pointing that out. But I consider the inicialization > as a side issue for the time being :) As long as the result is treated as a binary data and ibrd() always puts enough data in result_normal_plus[], initialization is not needed. If it's a string, you only need to make sure it's zero terminated at ibcnt. > Since later I put "end of string" mark at position 10 > ... > double) to the right place in the string (kind of saying "from this > point on take the following 8 characters as a double floating point > number"). > ... > So I use the information to cut the string in the right place. > Sometimes it could be 0, if something goes wrong with the devices on > gpib bus or the bus itself. You are confusing us here! The data is ASCII or binary? I guess if the device returns an ascii header, the rest must be ascii too. > > Did reading in ASCII, then converting with atof() work correctly? > > yes, it works well. No problem. Since atof takes a string, we are dealing with a string representation of a double here. So instead of printf("*presult: %.12f \n",*presult); you should use: printf("result: %s\n", presult); Because it's a string. > > How much time does it take to do it _correctly_? > well, I intend to run a measurement in a loop. One such loop has about > four atof() and whole together takes about 0.8 seconds to finish. As long as you are not dealing with thousands of measurments per second, I really doubt that it would make any difference in speed.Attachment: signature.asc
Description: PGP signature
- References:
- [tlug] issues with format of double (or IEEE754)
- From: Michal Hajek
- Re: [tlug] issues with format of double (or IEEE754)
- From: Jim
- Re: [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: [tlug] What does 80387 have to do with IEEE 754 issues? It's moot. (was Re: issues with format of double (or IEEE754))
- Previous by thread: Re: [tlug] issues with format of double (or IEEE754)
- Next by thread: Re: [tlug] issues with format of double (or IEEE754)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links