Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,888 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
accurate on 2 positions after decimal point #258761
04/01/09 23:51
04/01/09 23:51
Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
Shinobi Offline OP
User
Shinobi  Offline OP
User

Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
As in the Title mentioned , i need a code that is really exact and accurate after 2 points after decimal point. I thought with lite-c and float and double thats not a problem anymore but it is frown

Anyone have a idea how to do such maths calculations ?

Thanks.

Re: accurate on 2 positions after decimal point [Re: Shinobi] #258767
04/02/09 00:37
04/02/09 00:37
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
all hardware based binary floating point types have those representation errors.

you could write your own math functions (based on strings of digits) with algorithms similar to what you have learned in elementary school. smile

http://docs.python.org/library/decimal.html
or maybe something like the python decimal module could be interfaced from lite-c.

what do you need this for?

Re: accurate on 2 positions after decimal point [Re: ventilator] #258818
04/02/09 09:42
04/02/09 09:42
Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
Shinobi Offline OP
User
Shinobi  Offline OP
User

Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
Originally Posted By: ventilator

you could write your own math functions (based on strings of digits) with algorithms similar to what you have learned in elementary school. smile

Thats how i did it with wdl.


I need it for an math application.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1