From: PvdG42 on

"Jochen Kalmbach [MVP]" <nospam-news(a)kalmbach-software.de> wrote in message
news:u6MsRCSmKHA.3972(a)TK2MSFTNGP04.phx.gbl...
> Hi PvdG42!
>
>> "error C2039: 'Numerics': is not a member of 'System'"
>> "error C2871: 'Numerics': a namespace with this name does not exist"
>
> You either need to set the target-framework to .NET 4 or add the
> appropriate reference:
>
> - System.Numerics.dll
>
> --
> Greetings
> Jochen
>
> My blog about Win32 and .NET
> http://blog.kalmbachnet.de/

Thanks for your patience. Needed to "add reference". I'm *really* rusty.

From: GeorgCantor on
"GeorgCantor" wrote:
> One of the new additions to the .NET 4.0 framework is
> System.Numerics.BigInteger.
> Please can someone give a simple usage example?

Hi Georg,

(1) make a new project choosing the project template "CLR Cosole
Application" (not "Win32 Console Application" as I did :)

(2) Next, reference the System.Numerics class. Right-click on the project
name in Solution Explorer, choose "References..." and press the "Add New
Reference..." button. Under the .NET tab, choose System.Numerics.
(Thanks to Brian Muth for this hint.)

(3) Finally here a small piece of code:

#include "stdafx.h"
using namespace System;
using namespace System::Numerics;

int main()
{
int n, limit = 44;
BigInteger f = 1;

for (n = 0; n < limit; n++)
{
Console::WriteLine("{0}! = {1}", n, f.ToString());
f = BigInteger::Multiply(f, n + 1);
}
Console::ReadLine();
return 0;
}

Hope this helps.
Cheers, Georg