473,654 Members | 3,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What does it means?

I'm new on C# and I would like to know what it means and
if it is necessary.

decimal[] balances = new decimal[12];

decimal ttl = 0m;

What does 0m, means is necessary for the programman
that "m", what does it means????????

Thanks for all

Arthur
Nov 15 '05 #1
3 11975
Without m number will be treated as double, with m - as decimal.
Nov 15 '05 #2
Jim
Arthur,

In C++, which I'll assume you're familiar with, we can put
little modifiers after constants to identify the data type
of the constant (because the integer 0 and the floating
point number 0.0, while numerically equivalent, are stored
different in memory, again as I'm sure you already know).
Most languages have their own ways of representing these.
In C++, you refer to floating point constants with the
prefix f, like "float f = 0.0f", and long integers
like "long l = 2L". Visual BASIC uses modifers too, like
the % sign for integers, the & for long integers, the #
sign for double-precision floats, and the ! for single-
precision... I think that's right anyway.. a logn time
since I used VB....

Anyway, now that I've covered the erlavant background, the
answer to your question is that the "m" modifier
identifies the constant 0 as a "decimal" value, to match
the data type of the variable. I'm new to C# too, so if I
got that wrong, anyone feel free to chime in. :) I hope
that helps!

JIM
-----Original Message-----
I'm new on C# and I would like to know what it means and
if it is necessary.

decimal[] balances = new decimal[12];

decimal ttl = 0m;

What does 0m, means is necessary for the programman
that "m", what does it means????????

Thanks for all

Arthur
.

Nov 15 '05 #3
ArtPedUK <an*******@disc ussions.microso ft.com> wrote:
I'm new on C# and I would like to know what it means and
if it is necessary.

decimal[] balances = new decimal[12];

decimal ttl = 0m;

What does 0m, means is necessary for the programman
that "m", what does it means????????


"m" shows that the literal should be interpreted as a decimal as
opposed to an integer.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4

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

Similar topics

1
1742
by: pxlpluker | last post by:
Not clear on what documentation means here. What exactly does the underlined text mean. w & a obviously mean you are going to update the file. So what does the + mean on w+ & a+ mean? Also please could someone explain w+ truncating the file. I may just be dense so please be patient :) ------------------------------------------------------------------------- file( filename ] )
37
40474
by: Jon Perez | last post by:
I saw this code snippet: sock.listen(20) for _ in range(20): newsock, client_addr = sock.accept() print "Client connected:", client_addr data = "" why use _ for this example? Is there any optimization to be had using it?
70
8858
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this expression should equal to "sizeof( (int)(*p) )", but the compiler does NOT think so. Why? Can anyone help me? Thanks. Best regards. Roy
8
1715
by: Kim Forbes | last post by:
I am learning Javascript; and most books only give you partial definitions for the functions they show you. Here is a line of code from a browser sniffing function: var isWin = (navigator.platform.indexOf("Win") !=-1) ? true:false; What does the -1 stand for. Excuse me for such a basic question, but I can't find the answer anyway.
58
30210
by: Larry David | last post by:
Ok, first of all, let's get the obvious stuff out of the way. I'm an idiot. So please indulge me for a moment. Consider it an act of "community service".... What does "64bit" mean to your friendly neighborhood C# programmer? The standard answer I get from computer sales people is: "It means that the CPU can process 64 bits of data at a time instead of 32." Ok... I guess I *kind* of understand what that means at an intuitive level, but what...
4
3059
by: **Developer** | last post by:
Using Shell32.FolderItem's IsBrowsable I find, for example, that Internet Explorer and Printers and Faxes are browsable. I studied Help to find the definition of Browsable but could not find it. Can you tell me what Browserable means? Thanks in advance
2
13690
by: riceyeh | last post by:
Hi, What does <xsl:if test="not($values)"mean? What I do not understand is $values? Here, means array? And . = $value means current node is equal to the variable value? So the total meaning is "if not exists of value in array of values" ? But the result of '. = $value' is a boolean value, so '$values' should not mean "the value in values". Rice
1
2675
by: Frankie | last post by:
I have been learning about asynchronous method calls and I keep coming across this term, "marshal" and I would like to know what it means - specifically. AFAIKT, it means "send" but I suspect there is a bit more than that. Looking to online docs, MSDN talks about the System.Runtime.Interop.Marshal class - but I don't think that's relevant to what I'm seeing. Maybe it is... The following is an example of the sort of thing I've been...
92
6185
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8814
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8591
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.