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 (TipmyPip, AndrewAMD, NewbieZorro), 16,055 guests, and 7 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
Page 2 of 2 1 2
Re: Math problem... [Re: MMike] #295379
10/24/09 21:08
10/24/09 21:08
Joined: May 2008
Posts: 301
Oxy Offline
Senior Member
Oxy  Offline
Senior Member

Joined: May 2008
Posts: 301
if the reaction is 1:1 (one unit to one unit)
Then the percentage is:

(min : max) * 100

example: 90 units A and 120 units B

(90 : 120) = 0.75
0.75 * 100 = 75%


example: 55 units A and 7 units B

(7: 55) = 0.127
0.127 * 100 = 12.7%

Re: Math problem... [Re: Oxy] #295386
10/24/09 22:12
10/24/09 22:12
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
right.. i know! but to calculate the min and max of 2 numbers .. thats the point

because if you have 90/120 and what if you have 120/90 that wont work, so it must know the min, and you dont want to out that, thepc should calculate from what you have..

So i forgot the mnual , there is that function min(a,b) lool so much work

Re: Math problem... [Re: MMike] #295391
10/24/09 22:37
10/24/09 22:37
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Wouldnt this do what you are after?
result = minv(x,y) / maxv(x,y); as a 0.0->1.0 result
or
result = minv(x,y) / maxv(x,y) * 100; as a 0->100 (%) result


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Math problem... [Re: EvilSOB] #295401
10/25/09 00:13
10/25/09 00:13
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
yes it would.. but i didnt know there was a minv :S lool other wise i would avoid that math stuff lol.. well but it was fun to go trough it lol

Re: Math problem... [Re: MMike] #295438
10/25/09 11:06
10/25/09 11:06
Joined: May 2008
Posts: 301
Oxy Offline
Senior Member
Oxy  Offline
Senior Member

Joined: May 2008
Posts: 301
come on, even of there where no min function,
you could use
if (a>b) max=a: min=b;
else max=b;min=a

you should be able to figure that out...

Page 2 of 2 1 2

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