Constructor Function: real()

This section describes 'real' constructor function real().

New "real" data object can be created with the "real" constructor function, real(), which has the following syntax:

real(a = 0.0)

Parameters:
   a - A "real" data object. Default is 0.0.

Return: 
   Returns a new "real" data object representing 
   the same value as "a".

Examples of how to use "real" constructor function:

real(); # create a new data object representing 0.0

x = real(); # assign a new data object representing 0.0 to x

# assign a new data object representing 3.0 to y
y = real(1.0 + 2.0); 

Design options:

1. Let the constructor return 0.0 if no parameter provided.

2. Make the parameter as required for the constructor.

Last update: 2017.

Table of Contents

 About This Book

 Introduction of H Language

 Syntax

 Data Types

 Variables

 Expressions

 Statements

 "boolean" Data Type

 "integer" Data Type

 "string" Data Type

"real" Data Type

 What Is "real" Data Type

 "real" Literals

Constructor Function: real()

 "real" "addition" Operation

 "real" "subtraction" Operation

 "real" "multiplication" Operation

 "real" "division" Operation

 "real" "exponentiation" Operation

 "real" "negation" Operation

 "real" "absolute" Operation

 "real" "greater-than" Operation

 "real" "less-than" Operation

 "real" "equal-to" Operation

 "real" "not-equal-to" Operation

 "real" "greater-than-or-equal-to" Operation

 "real" "less-than-or-equal-to" Operation

 "array" Data Type

 Source Code Packages

 Classes and Objects

 Object Oriented Programming

 Inheritance - Object Attachments

 Encapsulation - Private Members

 References

 PDF Printing Version