Skip to content

Instantly share code, notes, and snippets.

View Calvin-Xu's full-sized avatar
🌹
自由を舞う薔薇のように 私は世界を変える

Calvin Xu Calvin-Xu

🌹
自由を舞う薔薇のように 私は世界を変える
View GitHub Profile
@Calvin-Xu
Calvin-Xu / math.c
Last active March 23, 2023 08:20
Implementation of some math.h functions
// uses only elementary methods
// guarantees none of speed, precision or accuracy
// I didn't read the specs
// does not handle any errors
// might be educational; definitely not practical
#include "math.h"
// double has 53 bits mantissa
// precision is log_10(2^53) = 15.9546