SunQuest
 
       ASP.NET Code
  Home arrow ASP.NET Code arrow Page 5 - ASP.NET Basics (part 2): Not My Type
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET CODE

ASP.NET Basics (part 2): Not My Type
By: Harish Kamath (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 27
    2003-07-30

    Table of Contents:
  • ASP.NET Basics (part 2): Not My Type
  • Building Blocks
  • A New Assignment
  • Strange Characters
  • Playing The Numbers
  • Operate With Caution
  • Everything Must Go
  • Cast And Credits
  • Mixing It Up
  • It's A Wrap

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    ASP.NET Basics (part 2): Not My Type - Playing The Numbers


    (Page 5 of 10 )

    Some programming languages (like PHP and VBScript) do not offer a range of numeric variables to play with, preferring instead to use one catch-all type; others (like C++ and Java) are very fussy and insist on offering you specialized data types for different purposes. In case you're wondering, yes, C# falls in the latter category.

    There are broadly three kinds of numeric data types in C#: integer, floating-point and decimal.

    1. Integers: These are plain-vanilla numbers like 23, 5748, -947 and 3; they are also the most commonly used type. Based on the range of the number being stored, the language has the following data types:

    - sbtye: stores a number between -127 to 127

    - short: stores a number between -32768 to 32767

    - int: stores a number between -2147483648 to -2147483647

    - long: stores a number between -9223372036854775808 to 9223372036854775807

    - byte: stores a number between 0 to 255

    - ushort: stores a number between 0 and 65535

    - uint: stores a number between 0 and 4294967295

    - ulong: stores a number between 0 and 18446744073709551615

    The first four data types are often referred to as "signed" integers while the last four are referred to as "unsigned" integers. This has to do with the fact that first bit for the signed integer data types is used to store information about which side of the number line the integer lies on (0 for positive integers, 1 for negative integers). Unsigned data types assume that their values are always positive (and use the extra bit to offer a wider range of storage).

    2. Floating-points: These are typically fractional numbers such as 12.5 or 3.149391239129. There are two floating-point data types.

    - float: stores a number between +/- 1.5 X 10-45 to +/- 3.4 X 1038

    - double: stores a number between +/- 5.0 X 10-324 to +/- 1.7 X 10308

    The main difference between the two types is in the "precision", or the number of significant figures after the decimal. If you want 7 or fewer significant digits after the decimal point (32-bit precision), use a "float"; if you want between 8 and 16 significant digits after the decimal point (64-bit precision), use a "double".

    3. Decimals: The "decimal" data type should be used when you require a high level of precision, since it can accurately store data up to 28 digits after the decimal points (128-bit precision).

    More ASP.NET Code Articles
    More By Harish Kamath (c) Melonfire


     

    ASP.NET CODE ARTICLES

    - How to Use the ListBox Control in ASP.NET 2.0
    - How to Load XML Documents in ASP.NET 2.0
    - DataGrid Code
    - ASP.NET Guestbook
    - User Controls and Client Side Scripting
    - ASP.NET Programming with Microsoft's AS...
    - ASP.NET Basics (part 3): Hard Choices
    - ASP.NET Basics (part 2): Not My Type
    - ASP.NET Basics (part 1): Nothing But .Net
    - Directory Tree Browser
    - How to get the confirmation of Yes/No from a...
    - Complete example using custom errors and wri...
    - Paging Certain # records per page .NET style
    - General Methods of formatting and Subtractin...
    - .NET LinkButton web control

    Iron Speed




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway