Operators Functions Order of Operations Mixed Mode Arithmetic VOID Data. Syntax and type conventions Using the Script window interface

Size: px
Start display at page:

Download "Operators Functions Order of Operations Mixed Mode Arithmetic VOID Data. Syntax and type conventions Using the Script window interface"

Transcription

1 Introduction Syntax Operators Functions Order of Operations Mixed Mode Arithmetic VOID Data Introduction Map Layer Mathematics Algebraic statements are used to perform the basic mathematical operations and functions that deal with constants and map layers. This is known as Layer Math, or Overlay Math. Algebraic operators and functions are performed on every cell in a specified map layer. If a map layer is multiplied by 1000, then each cell in the input map layer will be multiplied by If one map layer is subtracted from another, then all common cells are subtracted. Using More Than One Map Layer in an Algebraic Statement All the map layers that appear in an algebraic statement must have the same cell resolution, orientation, and at least one common cell. These parameters can be determined from the Information window of each map layer. The Script Window Operators and functions are applied in the Script window. To open a new Script window select New Script from the Windows menu. Syntax and type conventions Using the Script window interface Syntax Algebraic statements follow the same convention as operation statements in the Script window. They begin by stating the name of the new map layer to be generated. This is followed by an = symbol and then an algebraic expression. UG-ALG-1

2 Algebraic expressions can contain map names, operators, bracketing, and function names. An algebraic statement must contain at least one map layer name. The basic syntax is: newmap = expression; Algebraic statements can be complex. MFworks can handle complex, bracketed expressions that include multiple functions and operators, such as: map3 = map1 + (5.0 * SIN(map2)) / AVG(map2, 6); OR map4 = map3 * MAX(map1, map2, map3); Note: Algebraic statements cannot contain map Operations. UG-ALG-2

3 Operators Note: In the functions below, a, b, and c represent either a map name or a value. Performing Basic Math on Map Layers Determining Where One Map Layer is Greater Than Another Determining Where Two or More Relational Conditions are True 1) Monadic (one operator followed by one operand) Operator Meaning Example - Negative -a! or NOT Logical not!b or NOT b 2) Dyadic (Math) (one operator separating two operands) Operator Meaning Example * Multiplication a * b ^ Power/Exponent a^b (i.e., a b ) / Division a / b (i.e., a b) % Modulus a % b (i.e., a MOD b) + Addition a + b - Subtraction a - b 3) Dyadic (Relational) (one operator separating two operands) Operator Meaning Example < Less than a < b > Greater than a > b <= Less than or equal to a <= b >= Greater than or equal to a >= b == Equal to a == b!= Not Equal to a!= b 4) Dyadic (Logical) (one operator separating two operands) Operator Meaning Example or OR Logical or (a!= b) (a > c) & or AND Logical and a &!b UG-ALG-3

4 Functions Note: In the functions below, x represents either a map name or an expression. Applying Trigonometric Functions to a Map Layer Converting Fixed and Floating Point Data Types Finding the Maximum Non-VOID Value in a Stack of Map Layers Counting the Number of Cells With the Same Value 1) Trigonometric Functions SIN(x) COS(x) TAN(x) ARCSIN(x) ARCCOS(x) ARCTAN(x) return sine of x (x in radians) return cosine of x (x in radians) return tangent of x (x in radians) return arcsine of x return arccosine of x return arctangent of x 2) Logarithmic Functions EXP(x) return e x LOG(x) return log x (base e) LOG10(x) return log x (base 10) 3) Mode Functions FLOAT(x) TRUNC(x) PREC(x,y) convert x to a floating point entity convert x to an integer entity set precision of x to y decimal places 4) List Functions MAX(x1, x2, ) return maximum of list MIN(x1, x2, ) return minimum of list AVG(x1, x2, ) return average value of list MAXNV(x1, x2, ) return maximum of non-void values in list MINNV(x1, x2, ) return minimum of non-void values in list AVGNV(x1, x2, ) return average value of non-void values in list 5) Miscellaneous Functions ABS(x) return absolute value UG-ALG-4

5 COUNT(map) return cell count in map Order of Operations Introduction MFworks follows standard order of operations priority logic. This means that expressions are evaluated according to the priority assigned to operators in the expression. You may override the priority system by using brackets, as these have the highest priority. For example, multiplication and division are higher order operators than addition and subtraction: * 4 = 26 whereas, (6 + 5)*4 = 120 Priority System The priority system is as follows: 1) (highest) ( ) Brackets 2) - (negation),!, NOT Monadic 3) ^ Power/Exponent 4) *, /, % Multiplication, Division, Modulus 5) +, - (minus) Addition, Subtraction 6) <, <=, >, >= Relational 7) ==,!= Relational 8) AND, & Boolean And 9) (lowest) OR, Boolean Or Operators at the Same Level Operators that occur at the same level are evaluated from left to right: map1 == map2 <= map3 >= map4 is equivalent to: map1 == ((map2 <= map3) >= map4) map1 * map2 + map3 % (map4 - map5) is equivalent to: (map1 * map2) + (map3 % (map4 - map5)) UG-ALG-5

6 Mixed Mode Arithmetic MFworks follows standard mixed mode arithmetic logic when operands of different data types appear in an algebraic expression. When mixing floating point data type and integer data type map layers, the data type of the resultant map layer depends on the order of the map layers and the operators and functions that are used. All Integer/Fixed Point Data Operands If a given operator or function is passed all integer values, the result will be integer values. Using a Floating Point Operand If any operand of an operator or function is a floating point value, then all operands are promoted to floating point data and the result will be a floating point value. The following are exceptions to the rule: 1) All Trigonometric and Logarithmic functions return floating point data. 2) The PREC and FLOAT functions return floating point data. 3) The TRUNC and COUNT functions return integer data. 4) The relational operators (<, <=, >, >=, ==,!=) and the logical operators (AND, OR, NOT, &,,!) return integer results (1 or 0, where 1 = true and 0 = false). Constants Constants in an expression are considered to be integers unless they contain a decimal point. Using Brackets to Control Mixed Mode Arithmetic The extent of mixed mode arithmetic is bound by brackets. For example: 1. (3/4) is 5.0 not 5.75 and: 2. FLOAT(3/4) is also 5.0, not 5.75 but: 3. (3./4) is 5.75 and: 4. (FLOAT(3)/4) is 5.75 In the first example: (3/4) + 5.0, (3/4) is not promoted to floating point arithmetic because of the brackets. There are no decimal places allowed in integer arithmetic, therefore, 3 divided by 4 equals zero. Note: Integer math always truncates the result. UG-ALG-6

7 In the second example: FLOAT(3/4) + 5.0, the function FLOAT does not convert 3 divided by 4 into a floating point number, because, by order of operations, the 3 divided by 4 is performed first. FLOAT (0) equals zero. Again the presence of the brackets bound the rules of mixed mode arithmetic. In the third example: (3./4) + 5.0, mixed mode arithmetic is performed. The 4 is promoted to the floating point number 4.0 because a floating point value occurs within the brackets. In the final example: (FLOAT(3)/4) + 5.0, the order of operations makes the FLOAT (3) operation occur before dividing the 3 by 4, therefore, this operation is equivalent to the third example. Algebraic statements may contain up to 50 levels of bracketing. Expressions may be embedded in functions as in other programming languages. VOID Data How VOID is Handled in an Expression VOID is a special data value in MFworks. It is considered to be the absence of data. VOID appears in an expression only when it is part of a number list such as in a relational expression. Any expression that is performed on a cell with the value VOID, will result in VOID. For example: 1) 1 + VOID = VOID 2) SIN (VOID) = VOID 3) MAX (VOID, 1, 3) = VOID Exceptions to the Rule: VOID Always Returns VOID There are a few exceptions where VOID is handled differently: 1) The relational comparison operators == (equal) and!= (not equal) can be used to compare VOID to VOID cells. These operators will return either 1 or 0, but never VOID (i.e., VOID == VOID returns 1 while VOID = value returns 0 ). The other relational operators (<, <=, >, >=) will return VOID if the cell in one of the operand map layers is VOID (e.g., newmap = (maplayer1 >= VOID)). This is UG-ALG-7

8 because relationship is calculated mathematically and VOID has no numerical value. VOID > VOID returns VOID VOID <= value returns VOID value <= value returns either 1 or 0 2) The Non-VOID (NV) functions AVGNV, MAXNV, and MINNV ignore VOID cells. These functions will only return VOID if all the operand cells being compared are VOID. In the case of the average function, AVGNV, VOID cells do not contribute to the count of values to average. For example: while AVG (VOID, 1, 3) = VOID, MAX (VOID, 1, 3) = VOID, MIN (VOID, 1, 3) = VOID, AVGNV (VOID, 1, 3) = 2 MAXNV (VOID, 1, 3) = 3 MINNV (VOID, 1, 3) = 1 Expressions Not Containing VOID That Result in VOID Expressions that do not contain VOID may result in VOID if: 1) There is a floating point overflow or underflow (i.e., the number exceeds 1.0E38 or is less than 1.0E-38). 2) The result of the expression is undefined (e.g., division by 0, TAN(π/2), Log(-1)). UG-ALG-8

Chapter 4: Basic C Operators

Chapter 4: Basic C Operators Chapter 4: Basic C Operators In this chapter, you will learn about: Arithmetic operators Unary operators Binary operators Assignment operators Equalities and relational operators Logical operators Conditional

More information

9 Using Equation Networks

9 Using Equation Networks 9 Using Equation Networks In this chapter Introduction to Equation Networks 244 Equation format 247 Using register address lists 254 Setting up an enable contact 255 Equations displayed within the Network

More information

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Ordinary Differential Equation Solver Language (ODESL) Reference Manual Ordinary Differential Equation Solver Language (ODESL) Reference Manual Rui Chen 11/03/2010 1. Introduction ODESL is a computer language specifically designed to solve ordinary differential equations (ODE

More information

Arithmetic. 2.2.l Basic Arithmetic Operations. 2.2 Arithmetic 37

Arithmetic. 2.2.l Basic Arithmetic Operations. 2.2 Arithmetic 37 2.2 Arithmetic 37 This is particularly important when programs are written by more than one person. It may be obvious to you that cv stands for can volume and not current velocity, but will it be obvious

More information

Lesson #3. Variables, Operators, and Expressions. 3. Variables, Operators and Expressions - Copyright Denis Hamelin - Ryerson University

Lesson #3. Variables, Operators, and Expressions. 3. Variables, Operators and Expressions - Copyright Denis Hamelin - Ryerson University Lesson #3 Variables, Operators, and Expressions Variables We already know the three main types of variables in C: int, char, and double. There is also the float type which is similar to double with only

More information

3.1. Chapter 3: The cin Object. Expressions and Interactivity

3.1. Chapter 3: The cin Object. Expressions and Interactivity Chapter 3: Expressions and Interactivity 3.1 The cin Object Copyright 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 3-1 The cin Object Standard input stream object, normally the keyboard,

More information

Introduction to Programming

Introduction to Programming Introduction to Programming Department of Computer Science and Information Systems Tingting Han (afternoon), Steve Maybank (evening) tingting@dcs.bbk.ac.uk sjmaybank@dcs.bbk.ac.uk Autumn 2017 Week 4: More

More information

Product Price Formula extension for Magento2. User Guide

Product Price Formula extension for Magento2. User Guide Product Price Formula extension for Magento2 User Guide version 1.0 Page 1 Contents 1. Introduction... 3 2. Installation... 3 2.1. System Requirements... 3 2.2. Installation...... 3 2.3. License... 3 3.

More information

Chapter 2. Outline. Simple C++ Programs

Chapter 2. Outline. Simple C++ Programs Chapter 2 Simple C++ Programs Outline Objectives 1. Building C++ Solutions with IDEs: Dev-cpp, Xcode 2. C++ Program Structure 3. Constant and Variables 4. C++ Operators 5. Standard Input and Output 6.

More information

Programming in QBasic

Programming in QBasic Programming in QBasic Second lecture Constants In QBASIC: Constants In QBASIC division into three types: 1. Numeric Constants: there are two types of numeric constants: Real: the numbers used may be written

More information

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT PROGRAMMING WITH MATLAB DR. AHMET AKBULUT OVERVIEW WEEK 1 What is MATLAB? A powerful software tool: Scientific and engineering computations Signal processing Data analysis and visualization Physical system

More information

CSI31 Lecture 5. Topics: 3.1 Numeric Data Types 3.2 Using the Math Library 3.3 Accumulating Results: Factorial

CSI31 Lecture 5. Topics: 3.1 Numeric Data Types 3.2 Using the Math Library 3.3 Accumulating Results: Factorial CSI31 Lecture 5 Topics: 3.1 Numeric Data Types 3.2 Using the Math Library 3.3 Accumulating Results: Factorial 1 3.1 Numberic Data Types When computers were first developed, they were seen primarily as

More information

Macro Programming Reference Guide. Copyright 2005 Scott Martinez

Macro Programming Reference Guide. Copyright 2005 Scott Martinez Macro Programming Reference Guide Copyright 2005 Scott Martinez Section 1. Section 2. Section 3. Section 4. Section 5. Section 6. Section 7. What is macro programming What are Variables What are Expressions

More information

Functions and Inverses ID1050 Quantitative & Qualitative Reasoning

Functions and Inverses ID1050 Quantitative & Qualitative Reasoning Functions and Inverses ID1050 Quantitative & Qualitative Reasoning Function and Inverse Function Gun Analogy Functions take a number, perform an operation on it, and return another number. The inverse

More information

Operators and Expression. Dr Muhamad Zaini Yunos JKBR, FKMP

Operators and Expression. Dr Muhamad Zaini Yunos JKBR, FKMP Operators and Expression Dr Muhamad Zaini Yunos JKBR, FKMP Arithmetic operators Unary operators Relational operators Logical operators Assignment operators Conditional operators Comma operators Operators

More information

Numerical Data. CS 180 Sunil Prabhakar Department of Computer Science Purdue University

Numerical Data. CS 180 Sunil Prabhakar Department of Computer Science Purdue University Numerical Data CS 180 Sunil Prabhakar Department of Computer Science Purdue University Problem Write a program to compute the area and perimeter of a circle given its radius. Requires that we perform operations

More information

Process Optimization

Process Optimization Process Optimization Tier II: Case Studies Section 1: Lingo Optimization Software Optimization Software Many of the optimization methods previously outlined can be tedious and require a lot of work to

More information

Goals for This Lecture:

Goals for This Lecture: Goals for This Lecture: Understand integer arithmetic Understand mixed-mode arithmetic Understand the hierarchy of arithmetic operations Introduce the use of intrinsic functions Real Arithmetic Valid expressions

More information

TECH TIP VISION Calibration and Data Acquisition Software

TECH TIP VISION Calibration and Data Acquisition Software TECH TIP VISION Calibration and Data Acquisition Software May 2016 Using Calculated Channels in VISION Calculated channels are data items created in a Recorder file whose values are calculated from other

More information

Chapter 4. Operations on Data

Chapter 4. Operations on Data Chapter 4 Operations on Data 1 OBJECTIVES After reading this chapter, the reader should be able to: List the three categories of operations performed on data. Perform unary and binary logic operations

More information

ANSI C Programming Simple Programs

ANSI C Programming Simple Programs ANSI C Programming Simple Programs /* This program computes the distance between two points */ #include #include #include main() { /* Declare and initialize variables */ double

More information

The Graphing Calculator

The Graphing Calculator Chapter 23 The Graphing Calculator To display the calculator, select Graphing Calculator from the Window menu. The calculator is displayed in front of the other windows. Resize or re-position the Graphing

More information

Expressions and operators

Expressions and operators Mathematical operators and expressions The five basic binary mathematical operators are Operator Operation Example + Addition a = b + c - Subtraction a = b c * Multiplication a = b * c / Division a = b

More information

Introduction to Engineering gii

Introduction to Engineering gii 25.108 Introduction to Engineering gii Dr. Jay Weitzen Lecture Notes I: Introduction to Matlab from Gilat Book MATLAB - Lecture # 1 Starting with MATLAB / Chapter 1 Topics Covered: 1. Introduction. 2.

More information

CT 229 Java Syntax Continued

CT 229 Java Syntax Continued CT 229 Java Syntax Continued 06/10/2006 CT229 Lab Assignments Due Date for current lab assignment : Oct 8 th Before submission make sure that the name of each.java file matches the name given in the assignment

More information

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators JAVA Standard Edition Java - Basic Operators Java provides a rich set of operators to manipulate variables.

More information

Engineering Problem Solving with C++, Etter/Ingber

Engineering Problem Solving with C++, Etter/Ingber Engineering Problem Solving with C++, Etter/Ingber Chapter 2 Simple C++ Programs C++, Second Edition, J. Ingber 1 Simple C++ Programs Program Structure Constants and Variables C++ Operators Standard Input

More information

MYSQL NUMERIC FUNCTIONS

MYSQL NUMERIC FUNCTIONS MYSQL NUMERIC FUNCTIONS http://www.tutorialspoint.com/mysql/mysql-numeric-functions.htm Copyright tutorialspoint.com MySQL numeric functions are used primarily for numeric manipulation and/or mathematical

More information

Maths Functions User Manual

Maths Functions User Manual Professional Electronics for Automotive and Motorsport 6 Repton Close Basildon Essex SS13 1LE United Kingdom +44 (0) 1268 904124 info@liferacing.com www.liferacing.com Maths Functions User Manual Document

More information

2 Making Decisions. Store the value 3 in memory location y

2 Making Decisions. Store the value 3 in memory location y 2.1 Aims 2 Making Decisions By the end of this worksheet, you will be able to: Do arithmetic Start to use FORTRAN intrinsic functions Begin to understand program flow and logic Know how to test for zero

More information

Chapter 3: Operators, Expressions and Type Conversion

Chapter 3: Operators, Expressions and Type Conversion 101 Chapter 3 Operators, Expressions and Type Conversion Chapter 3: Operators, Expressions and Type Conversion Objectives To use basic arithmetic operators. To use increment and decrement operators. To

More information

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements Review: Exam 1 9/20/06 CS150 Introduction to Computer Science 1 1 Your First C++ Program 1 //*********************************************************** 2 // File name: hello.cpp 3 // Author: Shereen Khoja

More information

Data Types and Basic Calculation

Data Types and Basic Calculation Data Types and Basic Calculation Intrinsic Data Types Fortran supports five intrinsic data types: 1. INTEGER for exact whole numbers e.g., 1, 100, 534, -18, -654321, etc. 2. REAL for approximate, fractional

More information

Sketchify Tutorial Properties and Variables. sketchify.sf.net Željko Obrenović

Sketchify Tutorial Properties and Variables. sketchify.sf.net Željko Obrenović Sketchify Tutorial Properties and Variables sketchify.sf.net Željko Obrenović z.obrenovic@tue.nl Properties and Variables Properties of active regions and sketches can be given directly, or indirectly

More information

Expressions. Eric McCreath

Expressions. Eric McCreath Expressions Eric McCreath 2 Expressions on integers There is the standard set of interger operators in c. We have: y = 4 + 7; // add y = 7-3; // subtract y = 3 * x; // multiply y = x / 3; // integer divide

More information

Unit 3. Operators. School of Science and Technology INTRODUCTION

Unit 3. Operators. School of Science and Technology INTRODUCTION INTRODUCTION Operators Unit 3 In the previous units (unit 1 and 2) you have learned about the basics of computer programming, different data types, constants, keywords and basic structure of a C program.

More information

JAVA OPERATORS GENERAL

JAVA OPERATORS GENERAL JAVA OPERATORS GENERAL Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Arithmetic Operators Relational Operators Bitwise Operators

More information

The Expressions plugin PRINTED MANUAL

The Expressions plugin PRINTED MANUAL The Expressions plugin PRINTED MANUAL Expressions plugin All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechanical, including photocopying,

More information

Julia Calculator ( Introduction)

Julia Calculator ( Introduction) Julia Calculator ( Introduction) Julia can replicate the basics of a calculator with the standard notations. Binary operators Symbol Example Addition + 2+2 = 4 Substraction 2*3 = 6 Multify * 3*3 = 9 Division

More information

CHAPTER 3: CORE PROGRAMMING ELEMENTS

CHAPTER 3: CORE PROGRAMMING ELEMENTS Variables CHAPTER 3: CORE PROGRAMMING ELEMENTS Introduction to Computer Science Using Ruby A variable is a single datum or an accumulation of data attached to a name The datum is (or data are) stored in

More information

Arithmetic and Logic Blocks

Arithmetic and Logic Blocks Arithmetic and Logic Blocks The Addition Block The block performs addition and subtractions on its inputs. This block can add or subtract scalar, vector, or matrix inputs. We can specify the operation

More information

Program Workspace. Why numerical methods? Problem examples Why programming? Why numerical methods and programming? Why VBA?

Program Workspace. Why numerical methods? Problem examples Why programming? Why numerical methods and programming? Why VBA? Contents In the end we will conserve only what we love. We love only what we understand. We will understand only what we are taught.. Baba Dioum From a 1968 speech given at the general assembly of the

More information

9/10/10. Arithmetic Operators. Today. Assigning floats to ints. Arithmetic Operators & Expressions. What do you think is the output?

9/10/10. Arithmetic Operators. Today. Assigning floats to ints. Arithmetic Operators & Expressions. What do you think is the output? Arithmetic Operators Section 2.15 & 3.2 p 60-63, 81-89 1 Today Arithmetic Operators & Expressions o Computation o Precedence o Associativity o Algebra vs C++ o Exponents 2 Assigning floats to ints int

More information

Operators & Expressions

Operators & Expressions Operators & Expressions Operator An operator is a symbol used to indicate a specific operation on variables in a program. Example : symbol + is an add operator that adds two data items called operands.

More information

Introduction to Python, Cplex and Gurobi

Introduction to Python, Cplex and Gurobi Introduction to Python, Cplex and Gurobi Introduction Python is a widely used, high level programming language designed by Guido van Rossum and released on 1991. Two stable releases: Python 2.7 Python

More information

Lecture 2 FORTRAN Basics. Lubna Ahmed

Lecture 2 FORTRAN Basics. Lubna Ahmed Lecture 2 FORTRAN Basics Lubna Ahmed 1 Fortran basics Data types Constants Variables Identifiers Arithmetic expression Intrinsic functions Input-output 2 Program layout PROGRAM program name IMPLICIT NONE

More information

Week 2: Console I/O and Operators Arithmetic Operators. Integer Division. Arithmetic Operators. Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5.

Week 2: Console I/O and Operators Arithmetic Operators. Integer Division. Arithmetic Operators. Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5. Week 2: Console I/O and Operators Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5.1) CS 1428 Fall 2014 Jill Seaman 1 2.14 Arithmetic Operators An operator is a symbol that tells the computer to perform specific

More information

Python Lists: Example 1: >>> items=["apple", "orange",100,25.5] >>> items[0] 'apple' >>> 3*items[:2]

Python Lists: Example 1: >>> items=[apple, orange,100,25.5] >>> items[0] 'apple' >>> 3*items[:2] Python Lists: Lists are Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). All the items belonging to a list can be of different data type.

More information

STATGRAPHICS Operators

STATGRAPHICS Operators STATGRAPHICS Operators An important feature of STATGRAPHICS is the ability to construct expressions that create or transform data on-the-fly. For example, assume that a datasheet contains columns named

More information

The Expressions plugin PRINTED MANUAL

The Expressions plugin PRINTED MANUAL The Expressions plugin PRINTED MANUAL Expressions plugin All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechanical, including photocopying,

More information

Chapter 3. built in functions help feature elementary math functions data analysis functions random number functions computational limits

Chapter 3. built in functions help feature elementary math functions data analysis functions random number functions computational limits Chapter 3 built in functions help feature elementary math functions data analysis functions random number functions computational limits I have used resources for instructors, available from the publisher

More information

C++ Programming Lecture 11 Functions Part I

C++ Programming Lecture 11 Functions Part I C++ Programming Lecture 11 Functions Part I By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department Introduction Till now we have learned the basic concepts of C++. All the programs

More information

Expressions. Eric Roberts Handout #3 CSCI 121 January 30, 2019 Expressions. Grace Murray Hopper. Arithmetic Expressions.

Expressions. Eric Roberts Handout #3 CSCI 121 January 30, 2019 Expressions. Grace Murray Hopper. Arithmetic Expressions. Eric Roberts Handout #3 CSCI 121 January 30, 2019 Expressions Grace Murray Hopper Expressions Eric Roberts CSCI 121 January 30, 2018 Grace Hopper was one of the pioneers of modern computing, working with

More information

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Basic Operators Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Arithmetic Operators Relational Operators Bitwise Operators

More information

Department of Computer Science

Department of Computer Science Department of Computer Science Definition An operator is a symbol (+,-,*,/) that directs the computer to perform certain mathematical or logical manipulations and is usually used to manipulate data and

More information

Primitive Data Types: Intro

Primitive Data Types: Intro Primitive Data Types: Intro Primitive data types represent single values and are built into a language Java primitive numeric data types: 1. Integral types (a) byte (b) int (c) short (d) long 2. Real types

More information

Program Structure and Format

Program Structure and Format Program Structure and Format PROGRAM program-name IMPLICIT NONE specification part execution part subprogram part END PROGRAM program-name Comments Comments should be used liberally to improve readability.

More information

Introduction to C++ Introduction and History. Characteristics of C++

Introduction to C++ Introduction and History. Characteristics of C++ Introduction and History Introduction to C++ Until 1980, C programming was widely popular, and slowly people started realizing the drawbacks of this language and at the same time, the engineers had come

More information

GO - OPERATORS. This tutorial will explain the arithmetic, relational, logical, bitwise, assignment and other operators one by one.

GO - OPERATORS. This tutorial will explain the arithmetic, relational, logical, bitwise, assignment and other operators one by one. http://www.tutorialspoint.com/go/go_operators.htm GO - OPERATORS Copyright tutorialspoint.com An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.

More information

C Programs: Simple Statements and Expressions

C Programs: Simple Statements and Expressions .. Cal Poly CPE 101: Fundamentals of Computer Science I Alexander Dekhtyar.. C Programs: Simple Statements and Expressions C Program Structure A C program that consists of only one function has the following

More information

9. Elementary Algebraic and Transcendental Scalar Functions

9. Elementary Algebraic and Transcendental Scalar Functions Scalar Functions Summary. Introduction 2. Constants 2a. Numeric Constants 2b. Character Constants 2c. Symbol Constants 2d. Nested Constants 3. Scalar Functions 4. Arithmetic Scalar Functions 5. Operators

More information

C++ Overview. Chapter 1. Chapter 2

C++ Overview. Chapter 1. Chapter 2 C++ Overview Chapter 1 Note: All commands you type (including the Myro commands listed elsewhere) are essentially C++ commands. Later, in this section we will list those commands that are a part of the

More information

Chapter 1 Introduction to MATLAB

Chapter 1 Introduction to MATLAB Chapter 1 Introduction to MATLAB 1.1 What is MATLAB? MATLAB = MATrix LABoratory, the language of technical computing, modeling and simulation, data analysis and processing, visualization and graphics,

More information

4.7a Trig Inverses.notebook September 18, 2014

4.7a Trig Inverses.notebook September 18, 2014 WARM UP 9 18 14 Recall from Algebra 2 (or possibly see for the first time...): In order for a function to have an inverse that is also a function, it must be one to one, which means it must pass the horizontal

More information

The Arithmetic Operators. Unary Operators. Relational Operators. Examples of use of ++ and

The Arithmetic Operators. Unary Operators. Relational Operators. Examples of use of ++ and The Arithmetic Operators The arithmetic operators refer to the standard mathematical operators: addition, subtraction, multiplication, division and modulus. Op. Use Description + x + y adds x and y x y

More information

The Arithmetic Operators

The Arithmetic Operators The Arithmetic Operators The arithmetic operators refer to the standard mathematical operators: addition, subtraction, multiplication, division and modulus. Examples: Op. Use Description + x + y adds x

More information

Dr Richard Greenaway

Dr Richard Greenaway SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 3 Creating, Organising & Processing Data Dr Richard Greenaway 3 Creating, Organising & Processing Data In this Workshop the matrix type is introduced

More information

Walt Whitman High School SUMMER REVIEW PACKET. For students entering AP CALCULUS BC

Walt Whitman High School SUMMER REVIEW PACKET. For students entering AP CALCULUS BC Walt Whitman High School SUMMER REVIEW PACKET For students entering AP CALCULUS BC Name: 1. This packet is to be handed in to your Calculus teacher on the first day of the school year.. All work must be

More information

Built-in Types of Data

Built-in Types of Data Built-in Types of Data Types A data type is set of values and a set of operations defined on those values Python supports several built-in data types: int (for integers), float (for floating-point numbers),

More information

Learning the Language - V

Learning the Language - V Learning the Language - V Fundamentals We now have locations to store things so we need a way to get things into those storage locations To do that, we use assignment statements Deja Moo: The feeling that

More information

ME 142 Engineering Computation I. Unit 1.2 Excel Functions

ME 142 Engineering Computation I. Unit 1.2 Excel Functions ME 142 Engineering Computation I Unit 1.2 Excel Functions TOA Make sure to submit TOA If not submitted, will receive score of 0 Common Questions from 1.1 & 1.2 Named Cell PP 1.1.2 Name cell B2 Payrate

More information

MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY

MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY What is MATLAB? MATLAB (MATrix LABoratory) developed by The Mathworks, Inc. (http://www.mathworks.com) Key Features: High-level language for numerical

More information

Javascript Bignum Extensions

Javascript Bignum Extensions 1 Javascript Bignum Extensions Version 2018-05-27 Author: Fabrice Bellard i Table of Contents 1 Introduction................................................... 1 2 Operator overloading..........................................

More information

Chapter 3: Expressions and Interactivity. Copyright 2012 Pearson Education, Inc. Thursday, October 9, 14

Chapter 3: Expressions and Interactivity. Copyright 2012 Pearson Education, Inc. Thursday, October 9, 14 Chapter 3: Expressions and Interactivity 3.1 The cin Object The cin Object Standard input object Like cout, requires iostream file Used to read input from keyboard Information retrieved from cin with >>

More information

MATHEMATICAL / NUMERICAL FUNCTIONS

MATHEMATICAL / NUMERICAL FUNCTIONS MATHEMATICAL / NUMERICAL FUNCTIONS Function Definition Syntax Example ABS (Absolute value) ASC It returns the absolute value of a number, turning a negative to a positive (e.g. - 4 to 4) It returns the

More information

A complex expression to evaluate we need to reduce it to a series of simple expressions. E.g * 7 =>2+ 35 => 37. E.g.

A complex expression to evaluate we need to reduce it to a series of simple expressions. E.g * 7 =>2+ 35 => 37. E.g. 1.3a Expressions Expressions An Expression is a sequence of operands and operators that reduces to a single value. An operator is a syntactical token that requires an action be taken An operand is an object

More information

Module 2 - Part 2 DATA TYPES AND EXPRESSIONS 1/15/19 CSE 1321 MODULE 2 1

Module 2 - Part 2 DATA TYPES AND EXPRESSIONS 1/15/19 CSE 1321 MODULE 2 1 Module 2 - Part 2 DATA TYPES AND EXPRESSIONS 1/15/19 CSE 1321 MODULE 2 1 Topics 1. Expressions 2. Operator precedence 3. Shorthand operators 4. Data/Type Conversion 1/15/19 CSE 1321 MODULE 2 2 Expressions

More information

Watershed Sciences 4930 & 6920 GEOGRAPHIC INFORMATION SYSTEMS

Watershed Sciences 4930 & 6920 GEOGRAPHIC INFORMATION SYSTEMS HOUSEKEEPING Watershed Sciences 4930 & 6920 GEOGRAPHIC INFORMATION SYSTEMS CONTOURS! Self-Paced Lab Due Friday! WEEK SIX Lecture RASTER ANALYSES Joe Wheaton YOUR EXCERCISE Integer Elevations Rounded up

More information

10 Using the PCFL Editor In this chapter

10 Using the PCFL Editor In this chapter 10 Using the PCFL Editor In this chapter Introduction to the PCFL editor 260 Editing PCFL registers 261 Customizing the PCFL configuration file 272 ProWORX NxT User s Guide Introduction to the PCFL editor

More information

Solving for the Unknown: Basic Operations & Trigonometry ID1050 Quantitative & Qualitative Reasoning

Solving for the Unknown: Basic Operations & Trigonometry ID1050 Quantitative & Qualitative Reasoning Solving for the Unknown: Basic Operations & Trigonometry ID1050 Quantitative & Qualitative Reasoning What is Algebra? An expression is a combination of numbers and operations that leads to a numerical

More information

Scheme Quick Reference

Scheme Quick Reference Scheme Quick Reference COSC 18 Fall 2003 This document is a quick reference guide to common features of the Scheme language. It is not intended to be a complete language reference, but it gives terse summaries

More information

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning 4 Operations On Data 4.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three categories of operations performed on data.

More information

Green Globs And Graphing Equations

Green Globs And Graphing Equations Green Globs And Graphing Equations Green Globs and Graphing Equations has four parts to it which serve as a tool, a review or testing device, and two games. The menu choices are: Equation Plotter which

More information

JME Language Reference Manual

JME Language Reference Manual JME Language Reference Manual 1 Introduction JME (pronounced jay+me) is a lightweight language that allows programmers to easily perform statistic computations on tabular data as part of data analysis.

More information

MTH 120 Fall 2007 Essex County College Division of Mathematics Handout Version 6 1 October 3, 2007

MTH 120 Fall 2007 Essex County College Division of Mathematics Handout Version 6 1 October 3, 2007 MTH 10 Fall 007 Essex County College Division of Mathematics Handout Version 6 1 October, 007 1 Inverse Functions This section is a simple review of inverses as presented in MTH-119. Definition: A function

More information

VBScript: Math Functions

VBScript: Math Functions C h a p t e r 3 VBScript: Math Functions In this chapter, you will learn how to use the following VBScript functions to World Class standards: 1. Writing Math Equations in VBScripts 2. Beginning a New

More information

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop Announcements Lab Friday, 1-2:30 and 3-4:30 in 26-152 Boot your laptop and start Forte, if you brought your laptop Create an empty file called Lecture4 and create an empty main() method in a class: 1.00

More information

ESCI 386 IDL Programming for Advanced Earth Science Applications Lesson 1 IDL Operators

ESCI 386 IDL Programming for Advanced Earth Science Applications Lesson 1 IDL Operators ESCI 386 IDL Programming for Advanced Earth Science Applications Lesson 1 IDL Operators ARITHMATIC OPERATORS The assignment operator in IDL is the equals sign, =. IDL uses all the familiar arithmetic operators

More information

Appendix B The Floating Point Instruction Set

Appendix B The Floating Point Instruction Set Appendix B The Floating Point Instruction Set Appendix A described the generic form which co-processor instructions take. In this appendix, we look at a specific use of these instructions: the floating

More information

3.1. Chapter 3: The cin Object in Program 3-1. Displaying a Prompt 8/23/2014. The cin Object

3.1. Chapter 3: The cin Object in Program 3-1. Displaying a Prompt 8/23/2014. The cin Object Chapter 3: Expressions and Interactivity 3.1 The cin Object The cin Object The cin Object in Program 3-1 Standard input object Like cout, requires iostream file Used to read input from keyboard Information

More information

Chapter 3: Expressions and Interactivity

Chapter 3: Expressions and Interactivity Chapter 3: Expressions and Interactivity 3.1 The cin Object The cin Object Standard input object Like cout, requires iostream file Used to read input from keyboard Information retrieved from cin with >>

More information

CO212 Lecture 10: Arithmetic & Logical Unit

CO212 Lecture 10: Arithmetic & Logical Unit CO212 Lecture 10: Arithmetic & Logical Unit Shobhanjana Kalita, Dept. of CSE, Tezpur University Slides courtesy: Computer Architecture and Organization, 9 th Ed, W. Stallings Integer Representation For

More information

Part V Appendices c Copyright, Todd Young and Martin Mohlenkamp, Department of Mathematics, Ohio University, 2017

Part V Appendices c Copyright, Todd Young and Martin Mohlenkamp, Department of Mathematics, Ohio University, 2017 Part V Appendices c Copyright, Todd Young and Martin Mohlenkamp, Department of Mathematics, Ohio University, 2017 Appendix A Glossary of Matlab Commands Mathematical Operations + Addition. Type help plus

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Python Programming: An Introduction to Computer Science Chapter 3 Computing with Numbers Python Programming, 3/e 1 Objectives n To understand the concept of data types. n To be familiar with the basic

More information

Declaration and Memory

Declaration and Memory Declaration and Memory With the declaration int width; the compiler will set aside a 4-byte (32-bit) block of memory (see right) The compiler has a symbol table, which will have an entry such as Identifier

More information

Scheme Quick Reference

Scheme Quick Reference Scheme Quick Reference COSC 18 Winter 2003 February 10, 2003 1 Introduction This document is a quick reference guide to common features of the Scheme language. It is by no means intended to be a complete

More information

Mapping Figures Workshop University of Utah July 6, 2012 Martin Flashman A.1 Suppose f is a function determined by the following table :

Mapping Figures Workshop University of Utah July 6, 2012 Martin Flashman A.1 Suppose f is a function determined by the following table : A.1 Suppose f is a function determined by the following table : t -4-3 -2-1 0 1 2 3 4 f (t ) -5-2 0 3 6 3 2-5 0 A.2. Complete the following mapping figure for f with the indicated numbers (determine an

More information

Secondary Math 3- Honors. 7-4 Inverse Trigonometric Functions

Secondary Math 3- Honors. 7-4 Inverse Trigonometric Functions Secondary Math 3- Honors 7-4 Inverse Trigonometric Functions Warm Up Fill in the Unit What You Will Learn How to restrict the domain of trigonometric functions so that the inverse can be constructed. How

More information

6-1 (Function). (Function) !*+!"#!, Function Description Example. natural logarithm of x (base e) rounds x to smallest integer not less than x

6-1 (Function). (Function) !*+!#!, Function Description Example. natural logarithm of x (base e) rounds x to smallest integer not less than x (Function) -1.1 Math Library Function!"#! $%&!'(#) preprocessor directive #include !*+!"#!, Function Description Example sqrt(x) square root of x sqrt(900.0) is 30.0 sqrt(9.0) is 3.0 exp(x) log(x)

More information

Introduction to Computer Programming in Python Dr. William C. Bulko. Data Types

Introduction to Computer Programming in Python Dr. William C. Bulko. Data Types Introduction to Computer Programming in Python Dr William C Bulko Data Types 2017 What is a data type? A data type is the kind of value represented by a constant or stored by a variable So far, you have

More information