Twitter threads unrolled.
A comparison of many possible Python implementations of the sign function.
You didn't ask, but let me tell you I learned a lot of maths over at KhanAcademy.