Main Site Documentation

Error using MathEx class


#1

Hi Guys, i’m trying to use MathEx class, everything is right for the next code:

Debug.Print(GHIElectronics.NETMF.System.MathEx.PI.ToString());

But if i try to use other functions like this:

Debug.Print(GHIElectronics.NETMF.System.MathEx.Floor(2.3).ToString());

I get the follow error:
An unhandled exception of type ‘System.NotSupportedException’ occurred in USBizi Application.exe

What is wrong with my code?
any help?


#2

I’ve checked and those lines are working code.

Are you sure the error is on this exact line ?

Are you sure you have the latest firmware loaded along with the latest assemblies & VS2010 ?


#3

Yes I’m sure, that is the line that give me a error, the exact code is this:

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

using GHIElectronics.NETMF.Hardware;
using GHIElectronics.NETMF.System;


namespace testusbizi
{
    public class Program
    {
        public static void Main()
        {
  
            Debug.Print( MathEx.Floor(2.4).ToString());
        }

    }
}

Anyway i will try reinstalling all the enviroment.

Thanks Bec a Fuel


#4

Are you using the emulator? Are you sure this running on an actual hardware? See getting started guide.


#5

I’m using the default emulator, i guess. I’ll see getting started guide.


#6

These are GHI extensions, they do not work on the emulator.


#7

:wall: Didn’t think at that ::slight_smile:


#8

ooh So i’ll need some hardware for to try this code?
:frowning:


#9

There is also the option of extending the emulator so that it emulates the GHI math functions but that is quite involved.


#10

Ok guys, i understood, i’ll need the hardware.
Thanks for your help! :slight_smile: