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 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
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
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
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.
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
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
by: QQ |
last post by:
for example
~CcMessage() {}
Thanks a lot!
I am a beginner for C++, so please forgive my stupid questions
|
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.
|
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
|
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...
|
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...
|
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
|
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...
|
by: Daniel Brower |
last post by:
I found documentation that uses the ^ notation after a type name. What does
that notation mean?
Daniel
|
by: Monica Pnade |
last post by:
what does /^/ mean in perl?
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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...
| |