Languages Numeric Types

May 23, 2008 § 1 Comment

C & C++ References:

C Trivia:

  • In C, long is both modifier and data type.
  • Long Long Int is not available in C++
  • <limits.h> header contains max & min information of numeric types.

C & C++ Numerical Types:

  • ShortInt — 2 bytes and 16 bits
  • Int — 2 bytes and 32 bits
  • Long Int — 2 bytes and 32 bits
  • Long Long Int (C only) — 4 bytes and 64 bits
  • Double — 64 bits

CPython Reference:

CPython Numerical Types:

  • Int ( use Long Int in C ) — 32 bits precision.
  • Float (use Double in C) — 64 bits precision.
  • Long — Unlimited precision.
  • Complex (use Double in C)

Java References:

Java Primitive Numerical Types:

  • Short — 2 bytes and 16 bits
  • Int — 2 bytes and 32 bits
  • Long — 8 bytes
  • Float — 4 bytes
  • Double — 8 bytes

Java Other Numerical Types:

  • BigInt
  • BigDecimal

PHP References:

PHP Trivia:

  • There’s no real concept of numeric data type in PHP (PHP 4.2 and newer supporters can argue me on this).
  • You don’t set date type on numeric variables, PHP determines data type for you.
  • 32 bit systems have a maximum signed integer range of -2147483648 to 2147483647.
  • The maximum signed integer value for 64 bit systems is 9223372036854775807.

PHP Numerical “Types”:

  • bool
  • integer
  • float

Perl References:

Perl Numerical Types:

  • Integer
  • Float
  • Decimal

Perl Trivia:

  • Decimal strings may have an exponential notation part, as in "12.34e-56".
Advertisements

Tagged: , , , , , , , , , ,

§ One Response to Languages Numeric Types

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Languages Numeric Types at RAPD.

meta

%d bloggers like this: