I’m making a simple python math library with one, self imposed restriction: I can’t use integers.
AI is used only for learning, actual code is fully mine
I’m making a simple python math library with one, self imposed restriction: I can’t use integers.
AI is used only for learning, actual code is fully mine
I’ve done 2 things: Added a README to pypi (much easier than you could expect) and improved the docs by adding the example section+clarifying some things.
I think that’s it for this project.
Log in to leave a comment
I’ve added the AGENTS.md and made a few minor fixes.
Even if you don’t use AI in your project (like I do with this project), you should add AGENTS.md to it. There’s no guarantee potential contributors won’t use AI and even if you don’t like it, it’s better to get meh AI PR than bad AI PR, at least in my opinion.
My AGENTS.md is very minimal, but just that is enough to dramatically improve quality of vibe coded PRs (tested with Gemini CLI).
Log in to leave a comment
I’m really happy how that turned up.
I might want to revisit this project to implement better division and other arithmetical operations (Logarithms for example), but that doesn’t seems fun nor easy enough.
I’m absolutely sure I commit lots of horrible mistakes, but “If It’s Stupid and It Works, It’s Not Stupid”
The package is on pypi and ready. Creating it was much funnier than I thought it would be, it was a great experience.
Log in to leave a comment
As you can see, I’ve added functions for exponentiation, factorial and better substraction. Performance gains are massive.
I’m ready to publish it on pypi and write the docs.
On screenshots:
Log in to leave a comment
Multiplication is massively improved. Complexity went from O(n1n2) where n1 and n2 are components, to O(L1L2*(L1+L2)^2) where L1 and L2 are the lengths of input strings.
In the process, I also improved addition from O(max(L1, L2)L) to O(L1L2) where L1 and L2 are the lengths of input strings.
On the first picture there is new function, on the second is the old one. New was running for little less than one second, old was running for 5 seconds.
Log in to leave a comment
Basic arithmetic is working! However, the multiplication is quite slow, so that’s a thing to be fixed.
I also need to implement more operations, +-*/ is not enough for me.
Besides that, I also want it packaged in pypi, so that’s another thing to worry about.
Log in to leave a comment