Article View: alt.comp.lang.learn.c-c++
Article #769Re: float precision
From: dataman
Date: Thu, 13 Apr 2000 00:00
Date: Thu, 13 Apr 2000 00:00
50 lines
2789 bytes
2789 bytes
Thanks to all for the fast answers ..... Now, i understand why it's called "floating point" ....the precision changes ... I need float and not double ...Why ? I am building a 3d word , a big 3d world ..1000 km x 1000 km with 1 cm precision (= 100 000 000 units). In this 3d world all the objects have a Point/Vector position (float x,y,z) ...this is what the 3d engine needs (with relatively good precision)..and what i would like , is to keep in the abstract world representation. I want to avoid the conversion between world/3d engine co-ordinates .. I seen now , that this is not a good idea and not really possible ...hmm... Please ..if you have any suggestion ..ideas ...reply ... Thank you. -- The Aero Section : http://fly.to/TheAeroSection/ The Aero Section is a large military aircraft photo gallery. Karl Heinz Buchegger wrote: > dataman@cyberdude.com wrote: > > > > I am really confused about float precision ..officially it's 3.4 * > > (10**-38) to 3.4 * (10**+38) > > But, that does not help me much even it confuse me more .... > > > > Here is my problem: > > > > I need to define a world of 10 000 000 units . I need to use float for > > that . I think to use only the positive part (but will depend from the > > answer of my question). > > What precision (after the dot ) can i expect ? > > > > Not much. If you need to do some arithmetic on the > coordinates, and you will need to do this, you run > into big problems. floats usually have a precision > of 6 or 7 digits. If you do some arithmetics on > them, the error grows very rapidly, so better count > with 5 or 6 significant digits. Since you used all > of them for the integer part, ..... > > ----------------------------------------------------------- > Karl Heinz Buchegger > kbuchegg@gascad.at
Technical Details
Message-ID:
<38F5FA5B.813A2438@cyberdude.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<38F5D7E6.153591F2@cyberdude.com> <38F5E510.E33662C@gascad.at>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdcad,fcf1bc31a1ccc99f X-Google-Attributes: gidfdcad,public X-Google-Thread: 114592,fcf1bc31a1ccc99f X-Google-Attributes: gid114592,public X-Google-Thread: 109fba,fcf1bc31a1ccc99f X-Google-Attributes: gid109fba,public From: dataman@cyberdude.com Subject: Re: float precision Date: 2000/04/13 Message-ID: <38F5FA5B.813A2438@cyberdude.com> X-Deja-AN: 610734916 Content-Transfer-Encoding: 7bit References: <38F5D7E6.153591F2@cyberdude.com> <38F5E510.E33662C@gascad.at> X-Accept-Language: fr,en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sunrise.ch X-Trace: news1.sunrise.ch 955644500 12798 194.230.191.150 (13 Apr 2000 16:48:20 GMT) Organization: Usenet provided by sunrise communications ag Mime-Version: 1.0 Reply-To: dataman@cyberdude.com NNTP-Posting-Date: 13 Apr 2000 16:48:20 GMT Newsgroups: alt.comp.lang.learn.c-c++,comp.lang.c++,fr.comp.lang.c++