Math Problem For The Coli Geniuses

PikaDaDon

Thunderbolt Them Suckers
Joined
Oct 13, 2012
Messages
9,359
Reputation
2,323
Daps
25,320
Reppin
NULL
lol at calling a function and creating variable y when all you need is:
Code:
int my_function(int x) {
    return x * x [COLOR=#ff0000][B]+ x;[/B][/COLOR]
}

I wrote it like that for readability and simplicity. But yeah, my way would be considered 'slower' (for something like game development where performance matters) due to the function call (exp) and temporary variable (y).
 

humble forever

All Star
Joined
Jun 4, 2014
Messages
1,797
Reputation
211
Daps
3,536
90 lol geniuses. good luck in life yall


*edit* people writing this in code yeah...i can do that too:mjcry:


i'm guessing they're saying it's for geniuses and its not 63 because you need to make that leap when your mind thinks it's on a roll
 

Fun Sized Psycho

Floating on tooth shaped clouds
Supporter
Joined
Feb 7, 2014
Messages
4,236
Reputation
2,730
Daps
11,917
x = (y/x) - 1
x^2 = y - x
x^2 + x = y
f(x) = x^2 + x

f(2) = 6
f(3) = 12
f(4) = 20
f(5) = 30
f(6) = 42
f(7) = 56
f(8) = 72

f(9) = 90

@beanz
In simplistic terms, X is the number on the left in (), and Y is the number on the right.
So using 8:

8(squared) = 72 - 8
64 = 64

Or

8(squared) + 8 = 72
64 + 8 = 72

Or

8 = 8(squared) + 8
8 = 64 + 8
8 = 72
 
Top