Jump to content

reverse mathetical value


Fist

Recommended Posts

Posted

hello, once again i'm here with a little problem.

I wanted to know how can i reverse math algorithm?

For example, i have this.

lcoal currentDist = 100;
local originalDist = 500;

iprint(currentDist/originalDist); -- this will return 0.2;

but i want it to be other way around, so it gives me 0.8 not 0.2.

Ty in advance!

Posted

nevermind i solved this issue, if anyone else wonders how to do it, here's how.

iprint((orginalDist-currentDist)/orginalDist)

 

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...