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