473,473 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create 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 11940
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*******@discussions.microsoft.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.com>
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
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...
37
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...
70
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...
8
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 =...
58
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...
4
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....
2
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...
1
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...
92
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.