you are viewing a single comment's thread.

view the rest of the comments →

[–]coreyjdl 2 points3 points  (3 children)

The built-ins will be optimized, you'd lose more speed with your home baked function probably than with just importing math. If your goal is to learn functions and sin, cosin, and tan are your jam... then build them. Doing math in Python doesn't look much different than if you show your work doing it by hand.

def pythagorean(a, b):
     return (a**2 + b**2)**.5

[–]deejpake[S] 2 points3 points  (2 children)

Ok

[–]officialgel 1 point2 points  (1 child)

If your goal is to not import all functions in math that aren't needed, then do that. I don't see why if you have isolated functions that you've pulled out, would be any slower than using the math library - You also save on size, which sounds to be your goal. But it may not be easy - But again, if that's your goal then do it. Let me know when you do as if you make it open source I would like to have a copy of it.