Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,534 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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 | chip programmers | 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