473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

What does M mean just after a number?

Such as this:

return base.CalculatePrice() * 0.9M;

What data type does the 'M' stand for? I can't find a listing of these
shorthand notations anywhere.

Thanks,
Tom

Mar 31 '07 #1
7 16517
On Mar 30, 10:35 pm, tundra...@yahoo.com wrote:
Such as this:

return base.CalculatePrice() * 0.9M;

What data type does the 'M' stand for? I can't find a listing of these
shorthand notations anywhere.

Thanks,
Tom
decimal.

--
Tom Shelton

Mar 31 '07 #2
On 30 Mar 2007 21:35:36 -0700, tu*******@yahoo.com wrote:
>Such as this:

return base.CalculatePrice() * 0.9M;

What data type does the 'M' stand for? I can't find a listing of these
shorthand notations anywhere.

Thanks,
Tom
They are called type suffixes.

Integer type suffixes are: U, L, UL, LU, u, l, ul, lu, Ul, uL, Lu, lU
where U/u = unsigned and L/l = long. Lowercase l is not recommended
unless you want to obfuscate your source code.

Real type suffixes are: F, D, M, f, d, m where F/f = float, D/d =
double. M/m = Decimal

rossum

Mar 31 '07 #3
Thanks I appreciate it. But if 'M' means Decimal, then what does 'D'
stand for? Are both 'D' and 'M' decimal? If so why have both? Is
there a difference?

Thanks,
Tom
Mar 31 '07 #4
On Sat, 31 Mar 2007 10:58:48 -0700, <tu*******@yahoo.comwrote:
Thanks I appreciate it. But if 'M' means Decimal, then what does 'D'
stand for? Are both 'D' and 'M' decimal? If so why have both? Is
there a difference?
From the post you just replied to:

On Sat, 31 Mar 2007 01:59:16 -0700, rossum <ro******@coldmail.comwrote:
[...]
Real type suffixes are: F, D, M, f, d, m where F/f = float, D/d =
double. M/m = Decimal
I think that pretty much sums it up.
Mar 31 '07 #5
On 31 Mar 2007 10:58:48 -0700, tu*******@yahoo.com wrote:
>Thanks I appreciate it. But if 'M' means Decimal, then what does 'D'
stand for? Are both 'D' and 'M' decimal? If so why have both? Is
there a difference?

Thanks,
Tom
The L, U, F, and D suffixes are used in C, C++, Java and probably
elsewhere. When C# introduced the Decimal type the D suffix was
already in use for Double so they picked M instead.

rossum

Apr 1 '07 #6
MBR
To be more clear, M = Money, which is typcically what the type is used for,
becuase it avoids the round-off errors you get when using floating-point
representations like float and double. If you want to have numbers that are
quick to compute and can be super tiny or astronomically large but don't
care if some error is introduced (typically applications like games,
simulations, etc.) then use a float/double. If your want #'s in a
"reasonable" ranage but care about more presision and less error, then use a
decimal/money. (SQL also supports a similar type and it should always be
used for monetary amounts.)

http://en.csharp-online.net/ECMA-334...e_decimal_type

m

<tu*******@yahoo.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
Thanks I appreciate it. But if 'M' means Decimal, then what does 'D'
stand for? Are both 'D' and 'M' decimal? If so why have both? Is
there a difference?

Thanks,
Tom



--
Posted via a free Usenet account from http://www.teranews.com

Apr 1 '07 #7
MBR <no***@nospam.comwrote:
To be more clear, M = Money, which is typcically what the type is used for
<snip>

I believe that while M=Money is a good way of remembering it, Peter
Golde recalls it being picked just as the next appropriate character
from "decimal". I suspect that there'll never be any proof either way.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 1 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Charles Hixson | last post by:
I'm getting a list that I build which when printed is displaying, well, e.g.: d = << , 'Do', 'not', 'remove', 'thi', '.', ] >> Clearly I have a problem with the truncation of the final this, but...
4
by: QQ | last post by:
for example ~CcMessage() {} Thanks a lot! I am a beginner for C++, so please forgive my stupid questions
6
by: wintaki | last post by:
Given int x; What does x evaluate to? If x is 0, it equals 0x31, the ascii value of '1'. So for some reason, x evaluates to *(y+x) where x is a non pointer/array type.
1
by: alex14 | last post by:
Hi could someone please tell me what the double colons :: in perl scripts mean and what do they do? kind regards alex
2
by: SMichal | last post by:
Hi, I'm starting from my application simple bat data...test.bat. This file (test.bat) should start another aplication app.exe. I'm starting the test.bat from my application with Start() method of...
9
by: plusk1008 | last post by:
I have finals next week and I am stuck on one question on my review sheet for excel. So once again I beg: Please, please, please, please, please, please, please, please, please, please someone help...
2
by: mantrid | last post by:
in some php script ive seen $something==@$somethingelse whereas something==$somethingelse works the same what does the use of the @ do? Sorry if this is a stupid question
0
by: hini | last post by:
Hello, I see the N' in many asp , sql scripts at the beginning of a string usually and I don't know what's its meaning, I could not find anything about it when seraching google because of the...
1
by: Daniel Brower | last post by:
I found documentation that uses the ^ notation after a type name. What does that notation mean? Daniel
1
by: Monica Pnade | last post by:
what does /^/ mean in perl?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.