18
DavRant
6y

Hey everyone. I decided to rewrite python's abs() function, as it's really slow. Here is my new and improved version. It's up to 500% faster!!!

def abs(int=None):
if not int is None:
try:
lnt = math.sqrt(int);
lnt = math.pow(lnt, 2);
return lnt;
except Exception as E:
lnt = int/-1;
return lnt;
else:
raise ValueError("oopsie whoopsie! uwu we made a fucky wucky!!1 a wittle fucko boingo! the code monkies at our headquarters are working VEWY HAWD to fix dis!!");

Edit: devrant fucked up the indention.
Here is a hastebin instead:
https://hastebin.com/iyajuyoxuq.pl

Comments
  • 2
    Just gonna leave this here...
  • 2
    @ODXT mhm i know
  • 2
    MORE!
  • 2
  • 2
    Not sure if joking or not.
    The facts:
    1) everyone: "python is so great there is no better language"
    2) it has a slow abs func, which could be a joke because
    3) your error message is ridiculous

    1 and 2 are not compatible, 3 makes it even weirder.

    What the heck is going on.
  • 4
    @daintycode It's a stupid joke, that's all
  • 2
    Lol don't you just have to flip one bit that tells the number whether it's positive or negative?
Add Comment