Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Looking for a DLL that can do precise float calculating

Author
Message
Monzi
20
Years of Service
User Offline
Joined: 10th May 2004
Location: Denmark
Posted: 13th Aug 2006 17:37
Looking for a DLL that can do precise float calculations.

Read topic. I'm desperate
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 14th Aug 2006 01:11
It sounds like you don't accept the fact that you can only get a certain amount of precision with a computer. It's because of the way binary works, you see. Figure out how many decimals of accuracy you need and use that. What you're asking for is similar to me asking for a precise decimal value for 1/3 or a precise value of pi. Some things just have to be rounded and you'll have to live with it.

Good performance is better than a good excuse.
CodeSurge -- DBP Editor for serious programmers.
Monzi
20
Years of Service
User Offline
Joined: 10th May 2004
Location: Denmark
Posted: 14th Aug 2006 01:27
But how is it done in the MS Calculator program then? It must be possible somehow. I've seen countless aps where its possible. There must be some solution.
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 14th Aug 2006 02:29 Edited at: 14th Aug 2006 02:30
They probably get the number of significant digits needed, and round it. Here's a very interesting article explaining why it is the way it is and what you can do about it.
http://support.microsoft.com/kb/q125056/

Good performance is better than a good excuse.
CodeSurge -- DBP Editor for serious programmers.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Aug 2006 22:03
No, they use a arbitrary precision floating point system that doesn't use the floating-point unit of the CPU. Of course, it's much slower that way, but that doesn't matter when using the basic calc.exe

Usually, most people say 'sod it', and just use double floats, rounding and adjusting where necessary to make the numbers look nice.

Edgel
18
Years of Service
User Offline
Joined: 5th Jul 2006
Location: U.S.A
Posted: 14th Aug 2006 22:06
i read your post in another forum section Monzi and i have a suggestion. I think you should have the user choose how many decimals to include in thier outcome and round using that number. Make the max 4 or 5 so that the float differences dont mess things up.

Login to post a reply

Server time is: 2024-11-22 11:52:30
Your offset time is: 2024-11-22 11:52:30