Float Precision with PROC*C

From: Philippe Aubert <paubert_at_tdsb-s.mais.hydro.qc.ca>
Date: Wed, 6 Apr 1994 16:07:40 GMT
Message-ID: <CnuI4t.MD9_at_ireq.hydro.qc.ca>


        In an Oracle table (version 6.0.33), we have a field defined like this :

                NB_POINTS NUMBER(6,3)         IN a PRO*C program, we declared a float variable to receive the contents of the previous field :

                float nb_points;

        I have to make some calculation with this variable, so I don't want to translate it on CHAR or VARCHAR.

        Inside the table, if I have the number 0.100, the value returned with the function printf("%f",nb_points) is : 0.09999994039535522460938.

	Is someone aware of this problem ?
	How could I avoid it, without "playing with the external format"?   

			Thank you to give me a quick answer.

				Philippe AUBERT
Received on Wed Apr 06 1994 - 18:07:40 CEST

Original text of this message