Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 29th, 2006, 07:37 PM
Registered User
Join Date: Apr 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Math Namespace


I am new to C#, and I am testing out this example from Microsoft, however I keep on getting an error on Functions.Factorial method and that i am missing a refernce or assembly. I tried putting in the namespace system.math but the intellisense won't show up for the "math" option. Any advice?



Old January 29th, 2006, 07:37 PM
Registered User
Join Date: Apr 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Here's the link to the example.


Old February 11th, 2006, 01:00 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Intellisense is most likely failing because "system" needs to be uppercase:


Also, (I don't work with the Math namespace much) but is it possible that it is a missing reference?

Old February 12th, 2006, 09:50 AM
Posts: n/a

I don't think that reference to System.Math is the cause of your problem, as:

(1) Math class is part of the System namespace, and as long as you have a 'using System' ref. the code can access the Math members,

(2) Your code does not call any of the methods in the Math class.

The error message that you are getting is caused by not putting the Functions routine in the same namespace that you place the MainClass (or alternatively adding a reference to the namespace where Functions is located). If you use VS and create separate classes for MainClass and Functios, then VS will automatically add the namespace references for you (I think it uses the name of the project by default). If you are creating the files using a text editor, then you need to add the namespaces yourself,



Similar Threads
Thread Thread Starter Forum Replies Last Post
Math question dparsons ASP.NET 1.0 and 1.1 Professional 5 June 14th, 2006 02:31 PM
Math functions-Please help! jroxit ASP.NET 2.0 Basics 5 December 28th, 2005 12:21 PM
York Math -- regarding... vijayk Wrox Book Feedback 0 February 5th, 2005 06:23 AM
Math problem... help please! Varg_88 Classic ASP Basics 2 September 30th, 2004 05:17 AM
Math on a Form kelcontech Classic ASP Basics 4 May 12th, 2004 05:01 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.