f



Why (-0.7 + 0.4) - (-0.3) is not 0 ?

Is it a bug? How can I avoid such problems when I use ">0" or "<0"?
My version is 7.0 and the vi is programmed in WinXP.
Thank you !
0
x9561 (148439)
1/3/2006 3:40:11 AM
comp.lang.labview 35210 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

3 Replies
2084 Views

Similar Articles

[PageSpeed] 5

Hi cactus
 
No, this is not a bug. This has to do with the management of floating point numbers in a computer.
 
Refer to this threads:
<a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=102839&amp;query.id=2735#M102839" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=102839&amp;query.id=2735#M102839</a> 
<a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=152289&amp;query.id=2749#M152289" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=152289&amp;query.id=2749#M152289</a> 
&nbsp;
Hope this helps.
&nbsp;
Thomas
0
x9561 (148439)
1/3/2006 6:10:49 AM
Roughly said, 0.7, 0.4 and 0.3 are not round numbers when expressed in the binary system. Your question can be translated as :
why 1 - 0.6666 - 0.3333 is not equal to 0 ?
This was one of the very first things that were taught one generation ago to students learning computer programming ;). I'm not sure if this is still the case nowaday, since this question appears quite often on this forum. :D
&nbsp;
0
x9561 (148439)
1/3/2006 8:40:42 AM
It is still this case nowadays. At least 4 years ago at the school I went to ;).
&nbsp;
Thomas
0
x9561 (148439)
1/3/2006 10:11:43 AM
Reply:

Similar Artilces:

7.4beta1, Error in dumpall from 7.3.4 since CASCADE could not be used in REVOKE in 7.3.4
The following table was created in PostgreSQL 7.3.4 create table dummy_groupmember_is_admin (bemerkung varchar(20)); GRANT SELECT, UPDATE, INSERT ON dummy_groupmember_is_admin TO GROUP admin; REVOKE ALL ON dummy_groupmember_is_admin FROM cb,postgres; If I read in the dumpall from the PostgreSQL 7.3.4 database with PostgreSQL 7.4beta1 I get an error and the Hint that I should use CASCADE. The error line number points to: REVOKE ALL ON dummy_groupmember_is_admin FROM cb,postgres; But if I want to use CASCADE in PostgreSQL 7.3.4, I get a parse error. Indeed, the manual of 7....

After install 7.3.4, I got a 7.3.3 ver. no?
After install PostgreSQL 7.3.4, I got a 7.3.3 version no? $ psql template1 Welcome to psql 7.3.3, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit template1=# select version(); version ---------------------------------------------------------------------------- ---- --------- PostgreSQL 7.3.3 on i686-pc-cygwin, compiled by GCC gcc (GCC) 3.2 20020927 ...

pgsql-server: Preliminary release notes for 7.4.4, 7.3.7, 7.2.5.
Log Message: ----------- Preliminary release notes for 7.4.4, 7.3.7, 7.2.5. Will add to the back branches later. Modified Files: -------------- pgsql-server/doc/src/sgml: release.sgml (r1.281 -> r1.282) (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/doc/src/sgml/release.sgml.diff?r1=1.281&r2=1.282) ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html ...

AIX 4.3.3 , Oracle 7.3.4 coredumps at startup
I need to move an Oracle 7.3.4 database and application from an old AIX 4.2.1 J40 machine to a newer p660 box that is running 4.3.3 of AIX. I cannot port the database to Oracle 8 or later since the app progs are closed-source (was written in cobol), the vendor is not around anymore, and they used variable names imbedded in the sql of the apps that are now reserved words in Oracle 8 and later. I installed the Oracle 7.3.4 from cdrom onto the new machine, did a clone-style copy of the database filles over but the instant you run svrmgrl and try to do a "startup nomount" to get ready to create new controlfiles, Oracle 7.3.4 instantly coredumps. Even when trying to build the default demo ORCL database during 7.3.4 installation, it too coredumps instantly when it tries to start the Oracle engine for the first time. A hand-built, fresh, empty database instance will not start either. The new machine already has Oracle 8.1.7 running on it, installed in another filesystem, and I'm using the proper /etc/pw-syscall version 3 with support for both 32 and 64 bits. The AIX 4.3.3 is at ML9, and I have bos.rte.aio at version 4.3.3.75. Will Oracle 7.3.4 compiled for AIX 4.1/4.2 just simply not run on this new machine? The old machine had 7.3.4 and 8.0.5 running concurrently with no problems for a long time, but it's out of disk space now and I really need to get the database and apps onto the newer box since it has boatloats of disk space, ram, and cpu horsepower to spare...

pgsql-server: Minor copy-editing for 7.4.4, 7.3.7, 7.2.5 release notes.
Log Message: ----------- Minor copy-editing for 7.4.4, 7.3.7, 7.2.5 release notes. Modified Files: -------------- pgsql-server/doc/src/sgml: release.sgml (r1.282 -> r1.283) (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/doc/src/sgml/release.sgml.diff?r1=1.282&r2=1.283) ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly ...

Upgrade 7.3.3 to 7.4.5
Hi, I upgraded recently DB and found that some columns with type "timestamp" changed default values from now() to: receipt_date | timestamp with time zone | not null default '2004-09-29 09:58:03.010678+10'::timestamp with time zone ,where time is a time when psql -U postgres template1 < db_backup.sql was executed. I want to underline not all "timestamp default now()" columns but only some of them. Any ideas? Thank you, Igor "Igor Kryltsov" <kryltsov@yahoo.com> writes: > I upgraded recently DB an...

7.3.4 and 7.4 ORDER in queries
Hi, I'm not an expert, not by far. I've just installed postgres7.4 and have realized tat the order of rows in queries in different to that in 7.3.4. It seems that previously it was more logic, ordering by the first column, then by the second,... by default. At least this is so in a couple of queries I have. And now I have to explicitly say the order I want. Could someone just tell me why is this so? Thanks and best wishes, Javier ................ ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? ...

Upgrade from 7.3.4 to 7.4.6
Hello Can anyone point me to or near the reason why my pg_dumpall of my 7.3.4 DB and subsequent 7.4.6 psql restoration of that dump show up as a failure when I run my programs against it. I am using libpq as the DB interface. Program results are successful on the 7.3.4 system but I get seg-faults when attempting to run on 7.4.6. Recap: (7.3.4) pg_dumpall mydb > mydb_dump; (7.4.6) psql -f mydb_dump; all seem to go as expected until I run program procedures againt the 7.4.6 DB. My instant analysis: It seems to not like BINARY CURSOR. When I remove BINARY from the SQL DECLARE string, I no...

Upgrade from 7.3.4 to 7.4.6
Hello Can anyone point me to or near the reason why my pg_dumpall of my 7.3.4 DB and subsequent 7.4.6 psql restoration of that dump show up as a failure when I run my programs against it. I am using libpq as the DB interface. Program results are successful on the 7.3.4 system but I get seg-faults when attempting to run on 7.4.6. Recap: (7.3.4) pg_dumpall mydb > mydb_dump; (7.4.6) psql -f mydb_dump; all seem to go as expected until I run program procedures againt the 7.4.6 DB. My instant analysis: It seems to not like BINARY CURSOR. When I remove BINARY from the SQL DECLARE string, I no...

Move 9.4 (AIX 4.3.3) to 7.3 (HP-UX 10.20)
I need to move db of 10GB from AIX 4.3.3 Version 9.4 To HP-UX 10.20 Version 7.3 What is the best way. What options I have. Thanks to R. Ferronato for helping me to make fsize to -1 Did dbexport from AIX ( 3 tables are more than 2 GB. Had to change fsize to -1 to make it work). Thanks Basheer sending to informix-list Azeemuddin, Basheer wrote: > I need to move db of 10GB from AIX 4.3.3 Version 9.4 > > To > > HP-UX 10.20 Version 7.3 > > What is the best way. What options I have. > > Thanks to R. Ferronato for helping me to make fsize to -1 > > Did dbexport from AIX ( 3 tables are more than 2 GB. Had to change fsize to > -1 to make it work). > > > > Thanks > Basheer > sending to informix-list Seems really odd to go "backward" to an unsupported O/S HP-UX 10.20. If you have both instances available, just use remote selects - perhaps, or even dbload. ...

C function from 7.3.2 to 7.4.3
This is a multi-part message in MIME format. ------_=_NextPart_001_01C45FA9.7D119A80 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Greetings, =20 I have some C functions (was compiled against 7.3.2, I think) =20 CREATE FUNCTION "mud" () RETURNS TRIGGER AS '/xxx/pgsql/lib/du.so', 'mud' LANGUAGE 'C'; =20 It runs fine under 7.3.2, but I will get error when run the above CREATE FUNCTION under 7.4.3.=20 ERROR: could not load library "/xxx/lib/du.so": /xxx/lib/du.so: un...

Oracle 7.3.4 media for AIX 4.3
I have talked to Oracle customer support and they tell me that i cannot order un-supported software anymore. I have even searched on Ebay to see if someone is selling the CD pack. Google is also coming up empty. Anyone has any ideas on where i can get the CD pack for Oracle 7.3 on AIX 4.3. Yes i know we should not be on this version, but i cannot take the bandwidth to explain the reasoning. thx Ali ...

FW: Upgrade from 7.3.4 to 7.4.6
Clifford Reid Proximity Corporation Vice President, Global Product Support 1065 Avenue of the Americas, 26th Floor New York, New York 10018 Tel: 646-452-5820 Fax: 646-452-5821 Cell: 212-300-5639 creid@proximitygroup.com -----Original Message----- From: Cliff Reid [mailto:creid@proximitygroup.com] Sent: Monday, November 01, 2004 12:27 PM To: 'Tom Lane' Subject: RE: [ADMIN] Upgrade from 7.3.4 to 7.4.6 Tom Thanks for the reply, much appreciated. On-the-wire is a step in the right direction. To get a bit more out of you regarding this issue, what exactly is the correct method f...

FW: Upgrade from 7.3.4 to 7.4.6
Clifford Reid Proximity Corporation Vice President, Global Product Support 1065 Avenue of the Americas, 26th Floor New York, New York 10018 Tel: 646-452-5820 Fax: 646-452-5821 Cell: 212-300-5639 creid@proximitygroup.com -----Original Message----- From: Cliff Reid [mailto:creid@proximitygroup.com] Sent: Monday, November 01, 2004 12:27 PM To: 'Tom Lane' Subject: RE: [ADMIN] Upgrade from 7.3.4 to 7.4.6 Tom Thanks for the reply, much appreciated. On-the-wire is a step in the right direction. To get a bit more out of you regarding this issue, what exactly is the correct method f...

upgrading from VMS 7.3-2 and TCPIP 5.4 ECO 7 to VMS 8.4 and TCPIP 5.7
I upgraded a while back, but had read so much about the difficulties of this TCPIP upgrade and the lack of documentation concerning it, especially with respect to SMTP, that I have put off looking at it until now, and avoided using TCPIP on the upgraded node. I was surprised about two things. First, it doesn't appear that any of the TCPIP$* files were modified by the upgrade (yes, I did move files back to the system disk for the upgrade). Second, although I haven't done any extensive tests, it seems that everything just works. What am I missing? I haven't re-configured TCPIP since the upgrade. Is this necessary? Are the 5.7 and 5.4 configuration files compatible with each other, i.e. could I reconfigure with common files? Or do I have to reconfigure, use these as the new common files then upgrade the other nodes? Phillip Helbig (undress to reply) skrev den 2015-05-17 15:14: > I upgraded a while back, but had read so much about the difficulties of > this TCPIP upgrade and the lack of documentation concerning it, > especially with respect to SMTP, that I have put off looking at it until > now, and avoided using TCPIP on the upgraded node. > > I was surprised about two things. First, it doesn't appear that any of > the TCPIP$* files were modified by the upgrade (yes, I did move files > back to the system disk for the upgrade). Second, although I haven't > done any extensive tests, it seems ...

Upgrade from 7.3.4 to 7.4.2 went wrong
I get this error after doing the upgrade on FreeBSD 5.2.1: The data directory was initialized by PostgreSQL version 7.3, which is not compatible with this version 7.4.2 Should I just re-initdb and the import my dump file? -- Robert ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend Robert Fitzpatrick wrote: > I get this error after doing the upgrade on FreeBSD 5.2.1: > > The data directory was initialized by PostgreSQL version 7.3, which > is not compatible with this version 7.4.2 > > Shou...

VMS 7.2-1 / 7.3.4 / forms 4.5
Is anyone here in my boat: We are running OpenVMS 7.2-1, Oracle 7.3.4 and Forms 45 for our system. Has anyone here migrated their forms to something else, java or the like, and what are they using. Or do they have any plans to do so in the near future and what might their plans be? Alternatively does 7.3.4 and Forms4.5 work on VMS 7.3-1 even though it isn't desupported before I go and try it for myself? ...

Oracle 7.3.4 performance issues on AIX 4.3.2
Hi Guys, We are using AIX4.3.2 with Oracle 7.3.4 on F50 configured Paging space is 512MB with 40% max utilization. Database is installed on SSA RAID box(hdisk1) where we have configured RAID5. I have noticed immense performance issues with server in peak hrs, as per my observation before we / user execute any search query on database system performs in reasonable condition ASA we execute any search query server encounter extreme bottleneck issues Below I have given output of sar vmstat and iostat commands before executing search query and after executing search query, please advice how can we overcome this issue, required indexes are already available in oracle. Server performance before user execute any query on database. %usr %sys %wio %idle Sar Average 26 5 4 65 C/ >vmstat 1 10 kthr memory page faults cpu ----- ----------- ------------------------ ------------ ----------- r b avm fre re pi po fr sr cy in sy cs us sy id wa 1 1 68531 2043 0 1 1 75 228 0 250 1973 397 37 11 45 7 1 1 68531 2038 0 0 0 0 0 0 227 5586 202 27 7 61 5 1 1 68531 2038 0 0 0 0 0 0 209 5682 156 26 6 68 0 1 1 68531 2036 0 0 0 0 0 0 225 4890 324 39 6 50 5 1 1 68531 2036 0 0 0 0 0 0 207 5589 153 23 6 71 0 0 1 68531 2036 0 0 0 0 0 0 207 5310 145 25 4 71 0 0 1 68531 2036 0 0 0 0 0 0 212 5323 1...

VMS 7.2-1 / Oracle 7.3.4 / forms 4.5
Is anyone here in my boat: We are running OpenVMS 7.2-1, Oracle 7.3.4 and Forms 45 for our system. Has anyone here migrated their forms to something else, java or the like, and what are they using. Or do they have any plans to do so in the near future and what might their plans be? Or any suggestions? Alternatively does 7.3.4 and Forms4.5 work on VMS 7.3-1 even though it isn't desupported before I go and try it for myself? ...

VMS 7.2-1 / Oracle 7.3.4 / forms 4.5
Is anyone here in my boat: We are running OpenVMS 7.2-1, Oracle 7.3.4 and Forms 45 for our system. Has anyone here migrated their forms to something else, java or the like, and what are they using. Or do they have any plans to do so in the near future and what might their plans be? Alternatively does 7.3.4 and Forms4.5 work on VMS 7.3-1 even though it isn't desupported before I go and try it for myself? ...

PITR Phase 1
--Boundary-00=_8zFqAOOUHQ4FRkw Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I tried to backport Simon Riggs patches for 7.4.x series to 7.3.x with addition of python implementation of pg_arch. It can be of interest if you consider to continue using 7.3 series of postgresql. src/backend/access/transam/xlog.c: calls to "ereport" was replaced with call to "elog". src/backend/utils/misc/guc.c : format of "wal_archive" was converted to 7.3 style src/bin/Makefile: was remo...

A problem during restoring database from PostgreSql 6.5.3/7.1.3 to 7.4
Hello �� I can dump data from old dababase(Postgresql 6.5.3), but new problem came out when I restore the data to postgresql 7.4. It went out during the COPY command, if I do it in such command lines: 1. pg_dump news -f pgsql-database-news.sql #in old system with postgresql 6.5.3 2. su - postgres #in new system with postgresql 7.4 3. createdb -T template0 news 4. psql news < pgsql-database-news.sql ------ ERROR: missing data for column "user_id" CONTEXT: COPY newses, line 1: ------ But if I do it in such command line, it works well : 1. pg_dump -d news -f pgsql-data-news.sql #in old system with postgresql 6.5.3 2. su - postgres #in new system with postgresql 7.4 3. createdb -T template0 news 4. psql news < pgsql-data-news.sql The database looks fine but I'm not sure it is really good. Then I try postgresql 7.1.3, and I found that it is very well from 6.5.3 to 7.1.3 in the two kind of command line. Later I also found that it likes the 6.5.3 when I dump/restore the data from 7.1.3 to 7.4. Could Anybody explain it? Whether there is a version with big change between 7.1.3 and 7.4 or not? �� ���������������� ��������������������������Yours Wind Wood ����������������������������windwood@jingxian.xmu.edu.cn ����������������������������������2003-12-09 ---------------------------(end of broadcast)---------------------------TIP 5: Have you checked our extensive FAQ? ...

Is there any difference of g++ 3.4.3 and g++ 3.3.4 ?
HI, my source code was compiled ok in g++ 3.3.4 . But when I try to use 3.4.3 to compile, I get the following error: Utility.h: In constructor `Buffer<size>::Buffer(const char*)': Utility.h:174: error: `buffer' undeclared (first use this function) Utility.h:174: error: (Each undeclared identifier is reported only once for each function it appears in.) Utility.h:176: error: no matching function for call to `strchr(<type error>, char)' /usr/include/iso/string_iso.h:130: note: candidates are: char* strchr (const char*, int) /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/.....

Install Express Server 6.3.4 (8.1.7 / RedHat 7.3) problem
Hi, Having trouble installing Oracle Express Server. During the install, it stops at 57% complete while copying DSBATCH.inf. Any ideas? TIA Steve ...

Re: Date 1973/06/03 Conversion Problem in 7.3.4 and 7.3.2.
This is not a bug, but simply due to postgres date formatting. Observe thus: gbi=# set datestyle to 'iso'; SET gbi=# select to_date('03/06/1973','dd/mm/yyyy'); to_date ------------ 1973-06-03 (1 row) gbi=# set datestyle to 'us'; SET gbi=# select to_date('03/06/1973','dd/mm/yyyy'); to_date ------------ 1973-06-03 (1 row) gbi=# set datestyle to 'sql'; SET gbi=# select to_date('03/06/1973','dd/mm/yyyy'); to_date ------------ 06/03/1973 (1 row) datestyle can be permane...