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

Math.Truncate should return the integral part #392

Closed
MatthiasJentsch opened this issue Sep 1, 2018 · 2 comments · Fixed by nanoframework/nf-interpreter#836
Closed

Math.Truncate should return the integral part #392

MatthiasJentsch opened this issue Sep 1, 2018 · 2 comments · Fixed by nanoframework/nf-interpreter#836

Comments

@MatthiasJentsch
Copy link
Contributor

MatthiasJentsch commented Sep 1, 2018

Details about Problem

nanoFramework area: nanoCLR

Worked before? Yes

Detailed repro steps so we can see the same problem

Math.Truncate should return the integral part. But I've found

float res = 0.0;
float retVal = modff(d, &res); 

stack.SetResult_R4( retVal );

in Library_corlib_native_System_Math::Truncate___STATIC__R4__R4
This code returns the fractional part.

@NemesisXB
Copy link
Contributor

I will fix this.

@josesimoes
Copy link
Member

This is because of a recent code change replacing the original code with the calls to the CRT standard lib functions. The args in the call are reversed if I remember correctly... 😊

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

Successfully merging a pull request may close this issue.

3 participants