#I have an equation I'd like help setting up

27 messages · Page 1 of 1 (latest)

crude lion
#

I'm creating an equation relating to a game that involves pi and whatnot but that isn't important, im looking to make an equation where x, the flexible value (aka the average block interaction count) is inputted into an equation as such (x * 3.14) / 4. However I do not know how to express the next part of the equation where it Rounds to the nearest single digit that is also an even number, thanks for your help!

formal templeBOT
rich shore
#

Something like this? 2 * round(((x / 2) * 3.14) / 4)

#

,w plot 2 * round(((x / 2) * 3.14) / 4)

crude lion
#

ok, lets see if it works

#

see what happens if x = 11

#

the output should be 8 hopefully

rich shore
#

8

#

,w 2 * round(((11 / 2) * 3.14) / 4)

crude lion
#

,w 2 * round(((16 / 2) * 3.14) / 4)

crude lion
#

awesome!

#

is there any way i could represent this equation more algebraically?

rich shore
#

is there a need to?

crude lion
#

No however it would be more elegent, im hoping to turn this into a standard for something

rich shore
#

you could do some clever boolean maths with doubles but i am afraid I will still have to use round or ceil or floor, otherwise use some approximants which would have bad performance

crude lion
#

hm

#

thank you by the way!

#

i know how to generally represent the equation

#

i think i got what i needed

#

have a happy holiday and new year by the way

rich shore
#

happy new year

crude lion
#

.solved

formal templeBOT
#
Solved

Post marked as solved by @marsh crown.

Use .unsolved if this was a mistake.

crude lion
#

so i could represent my equation as: