Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Visual J# / February 2004

Tip: Looking for answers? Try searching our database.

Problem while defining constants

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reshma - 20 Feb 2004 06:16 GMT
In C# for defining decimal constants we use suffix M
For Example
       ShowDecimalGetBits( 10000000000000000000000000000M )
       ShowDecimalGetBits( 100000000000000.00000000000000M )
       ShowDecimalGetBits( 1.0000000000000000000000000000M )
       ShowDecimalGetBits( 0.123456789M )
       ShowDecimalGetBits( 0.000000000123456789M )
       ShowDecimalGetBits( 0.000000000000000000123456789M )
       ShowDecimalGetBits( -7.9228162514264337593543950335M )
where ShowDecimalGetBits is a method which takes argumant as decimal
What is the equivalent for M in J#?If we write M in J#, it gives error

Thanks
Lars-Inge T?nnessen - 20 Feb 2004 20:48 GMT
/**
* Summary description for Class1.
*/
public class Class1
{
   private final double one = 1.0000000000000000000000;
   private final double two = 100000000000000.00000000000000;
   private final double three = 1.0000000000000000000000000000;
   private final double four = 0.123456789;
   private final double five = 0.123456789;
   private final double six = 0.000000000123456789;
   private final double seven = 0.000000000000000000123456789;
   private final double eight = -7.9228162514264337593543950335;

   public Class1()
   {
       ShowDecimalGetBits( one );
       ShowDecimalGetBits( two );
       ShowDecimalGetBits( three );
       ShowDecimalGetBits( four );
       ShowDecimalGetBits( five );
       ShowDecimalGetBits( six );
       ShowDecimalGetBits( seven );
       ShowDecimalGetBits( eight );
    }

   public void ShowDecimalGetBits( double numb )
   {
       System.Console.WriteLine("[out] ->"+numb );
   }

   /** @attribute System.STAThread() */
   public static void main(String[] args)
   {
       new Class1();
   }
}

Signature

Regards,
Lars-Inge T?nnessen
http://emailme.larsinge.com
http://www.larsinge.com

Michael Green - 20 Feb 2004 23:49 GMT
There is no equivalent to C#'s M in J#. You should be able to just be able
to specify the decimal constant.

Thanks,

Michael Green
Microsoft Developer Support

--------------------
| Thread-Topic: Problem while defining constants
| thread-index: AcP3eQWscbKFGz0bTkSsZ/cGGWNtQQ==
[quoted text clipped - 20 lines]
|
| In C# for defining decimal constants we use suffix M.
For Example,
       ShowDecimalGetBits( 10000000000000000000000000000M );
       ShowDecimalGetBits( 100000000000000.00000000000000M );
       ShowDecimalGetBits( 1.0000000000000000000000000000M );
       ShowDecimalGetBits( 0.123456789M );
       ShowDecimalGetBits( 0.000000000123456789M );
       ShowDecimalGetBits( 0.000000000000000000123456789M );
       ShowDecimalGetBits( -7.9228162514264337593543950335M );
where ShowDecimalGetBits is a method which takes argumant as decimal.
What is the equivalent for M in J#?If we write M in J#, it gives error.

Thanks

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.