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.Floor(float) hangs/resets the board on Netduino 3 #387

Closed
steffalk opened this issue Aug 26, 2018 · 1 comment · Fixed by nanoframework/nf-interpreter#827
Closed

Comments

@steffalk
Copy link
Member

VS version: VS 2017 15.8.1
OS version: Windows 10 1803 17134.228
VS extension version: 0.5.0.28
Firmware version: preview-776

This worked about 2 months ago.

Detailed repro steps so we can see the same problem

  1. Create a nanoFramework solution:

`
using System;

namespace NFAppTestMathHang
{
public class Program
{
public static void Main()
{
Console.WriteLine("Hello world!");

        float x;

        x = Math.Round(5.5f); // <-- works after Jose´s fix.

        x = Math.Floor(5.5f); // <-- hangs here to the point that the board must be re-flashed!

        Console.WriteLine(x.ToString()); // <-- never arrives here
    }
}

}
`

  1. Run it on the board. The board hangs on Math.Floor.
@josesimoes
Copy link
Member

Nice catch! (oh how we need unit testing 😢 )

BTW, most of the other math methods would cause this too. I've rework the math calls to fix it for all calls.

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.

2 participants