পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Monday, February 6, 2017

Rexx - DataTypes

In any programming language, you need to use various variables to store various types of information. Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in the memory to store the value associated with that variable.

You may like to store information of various data types like String, Character, Wide Character, Integer, Floating Point, Boolean, etc. Based on the data type of a variable, the operating system allocates memory and decides what can be stored in the reserved memory.

Built-in Data Types

Rexx offers a wide variety of built-in data types. Following is a list of data types which are defined in Rexx.
  • Integer − A string of numerics that does not contain a decimal point or exponent identifier. The first character can be a plus (+) or minus (-) sign. The number that is represented must be between -2147483648 and 2147483647, inclusive.
  • Big Integer − A string of numbers that does not contain a decimal point or an exponent identifier. The first character can be a plus (+) or minus (-) sign. The number that is represented must be between -9223372036854775808 and 2147483648, inclusive, or between 2147483648 and 9223372036854775807.
  • Decimal − It will be from one of the following formats −
    • A string of numerics that contains a decimal point but no exponent identifier. The p represents the precision and s represents the scale of the decimal number that the string represents. The first character can be a plus (+) or minus (-) sign.
    • A string of numerics that does not contain a decimal point or an exponent identifier. The first character can be a plus (+) or minus (-) sign. The number that is represented is less than -9223372036854775808 or greater than 9223372036854775807.
  • Float − A string that represents a number in scientific notation. The string consists of a series of numerics followed by an exponent identifier (an E or e followed by an optional plus (+) or minus (-) sign and a series of numerics). The string can begin with a plus (+) or minus (-) sign.
  • String − A normal string of characters.
Following are some examples of how each data type can be used. Again each data type will be discussed in detail in the subsequent chapters. This is just to get you up to speed with a brief description of the above mentioned data types.

Integer

An example of how the number data type can be used is shown in the following program. This program shows the addition of 2 Integers.
Example
/* Main program 
The below program is used to add numbers 
Call the add function */ 
add(5,6)  

exit 
add:  

parse arg a,b 
say a + b 
The output of the above program will be −
11

Big Integer

The following program shows the capability of Rexx to handle big integers. This program shows how to add 2 big integers.
Example
/* Main program 
The below program is used to add numbers 
Call the add function */ 
add(500000000000,6000000000000000000000)  

exit 
add:  

parse arg a,b 
say a + b
The output of the above program will be −
6.00000000E+21

Decimal

The following program shows the capability of Rexx to handle decimal numbers. This program shows how to add 2 decimal numbers.
Example
/* Main program 
The below program is used to add numbers 
Call the add function */ 
add(5.5,6.6)  

exit 
add:  

parse arg a,b 
say a + b 
The output of the above program will be −
12.1 

Float

The following example show cases how a number can work as a float.
Example
/* Main program 
The below program is used to add numbers 
Call the add function */ 
add(12E2,14E4)  

exit 
add:  

parse arg a,b 
say a + b
The output of the above program will be −
141200

String

An example of how the Tuple data type can be used is shown in the following program.
Here we are defining a Tuple P which has 3 terms. The tuple_size is an inbuilt function defined in Rexx which can be used to determine the size of the tuple.
Example
/* Main program */ 
display("hello")  

exit 
display:  

parse arg a 
say a
The output of the above program will be −
hello

No comments:

Post a Comment