Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some more functions to the math library #213

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

maurizio-lombardi
Copy link
Member

@maurizio-lombardi maurizio-lombardi commented Jun 19, 2021

Hello guys,

To make the porting of the NES emulator possible, I needed a few math operations (log(), sqrt(), pow() and scalbn()) that are not available in the mainline HelenOS tree.
Manuele copied part of the msun math library (BSD-like licensed, very permissive) and then I synced it to a recent version of the FreeBSD src tree.

I am 100% aware that you don't like to merge code coming from other projects, yet this code was rotting in my private branch and I opened this pull request just to make you aware that some work has been done in this area. I'm not asking to merge it right now, it may become useful in future.

Note: I had to fix a "comparison between signed and unsigned integers" warning that prevented the code from successfully building. I think my patch is safe, but requires some careful review... because all of this math code looks like black magic to me.

@maurizio-lombardi maurizio-lombardi changed the title Add a some more functions to the math library Add some more functions to the math library Jun 20, 2021
@jxsvoboda
Copy link
Contributor

Hi Maurizio! Thanks! pow(), log() and sqrt() were available in HelenOS until they were unceremoniuously ripped out in changeset 516e780
I think we might try to revive the old code (while adding some rreasonable tests and making sure it's sane). I'd prefer having a say less efficient and reasonable accurate, but understandable version that one that is super optimized and accurate, but obscure.
Cheers,
Jiri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants