Math class Random() method Floor method Top-level parseInt function

Slides:



Advertisements
Similar presentations
Maths & Trig, Statistical functions. ABS Returns the absolute value of a number The absolute value of a number is the number without its sign Syntax ◦
Advertisements

Copyright 2006 by Pearson Education 1 Building Java Programs Chapter 3: Parameters, Return, and Interactive Programs with Scanner.
Datalogi A 3: 26/9. Java Concepts chapter 4 Fundamental Data Types int (long and short) double (and float) boolean char String.
Computer Science A 2: 6/2. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated.
= 9 = 8 = 12 = 19 = 2 = 3 = 17 = 5 = 11 = 5.
6-1 Percent Percent: a ratio that compares a number to 100
The natural number e and solving base e exponential equations
1 CS101 Introduction to Computing Lecture 38 String Manipulations (Web Development Lecture 13)
1 CS101 Introduction to Computing Lecture 35 Mathematical Methods (Web Development Lecture 12)
Math Circumference of Circles & Area of Circles. Vocabulary A circle is the set of all points in a plane that are the same distance from a given point,
JavaScript Part 2 – Page 1 of 35CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: JavaScript Part 2.
1 Intro to Computer Science I Chapter 2 Fundamental Data Types Java scripting with BeanShell.
Native JavaScript in Hyperion Intelligence Unleashing the Power of Object- Oriented Programming.
Functions and Modules CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Chapter 4: Fundamentals of JavaScript 4.1 Capabilities 4.2 Essential Terminology 4.3 Structure of JavaScript Code 4.4 Data and Objects 4.5 Tokens, Operators,
Copyright ©2005  Department of Computer & Information Science Using Number & Math Objects.
Javascript. Javascript Tools Javascript Console Javascript Console Debugger Debugger DOM Inspector DOM Inspector.
Objects.  Java Script is an OOP Language  So it allows you to make your own objects and make your own variable types  I will not be going over how.
Find the two square roots of each number. Exploring Square Roots and Irrational Numbers COURSE 3 LESSON 4-8 a = 81 –9 (–9) = 81 The two square.
Mt. Rushmore, South Dakota CSE 114 – Computer Science I Static Methods andVariables.
SE-1010 Dr. Mark L. Hornick 1 Some Java Classes using & calling methodsS.
More on Objects. Goals By the end of this unit you should … … be able to identify selected String properties … be able to identify and use selected String.
CSC Programming for Science Lecture 7: Math Functions.
Big Java by Cay Horstmann Copyright © 2009 by John Wiley & Sons. All rights reserved. int: integers, no fractional part: 1, -4, 0 double : floating-point.
Math Class Part of the Java.lang package. This package is from object so you do not have to import the lang package. Static: Math Class is static.
Numbers © Copyright 2014, Fred McClurg All Rights Reserved.
Basic Data Types Numbers (integer and floating point)‏ Strings (sequences of characters)‏ Boolean values (true/false)‏
Introduction As programmers, we don’t want to have to implement functions for every possible task we encounter. The Standard C library contains functions.
Php – Math functions. FunctionDescription abs()Returns the absolute value of a number ceil()Returns the value of a number rounded upwards to the nearest.
CSCE 102 – Chapter 11 (Performing Calculations) CSCE General Applications Programming Benito Mendoza Benito Mendoza 1 By Benito Mendoza.
The Math class Java provides certain math functions for us. The Math class contains methods and constants that can be very useful. The Math class is like.
Level34567 Place Value and Calculations 2 I can round whole numbers to the nearest 10, 100 or I can find multiples of any numbers up to 12. I can.
Creating and Using Class Methods. Definition Class Object.
Hazırlayan:Emin BORANDAĞ 2/17/ Numerik Değerler Kullanımı Integers are considered accurate up to 15 digits. Try it function myFunction() { var x.
2.4 More Apportionment Algorithms and Paradoxes Ms. Magné Discrete Math.
ICS 3U Math Class. ActionScript 3 – Math Class Rounding ceil – closest integer >= number (rounds up) floor – closest integer
JavaScript Tutorial. What is JavaScript JavaScript is the programming language of HTML and the Web Programming makes computers do what you want them to.
Do Now:. Circumference What is circumference? Circumference is the distance around a circle.
CSE 110: Programming Language I Afroza Sultana UB 1230.
Chapter 4 Mathematical Functions, Characters, and Strings 1.
Chapter 4 Mathematical Functions, Characters, and Strings
Fundamentals of Programming I Default and Optional Parameters
Circles: Circumference & Area
Check your understanding!
Building Java Programs
Programming the Web using XHTML and JavaScript
Java Script.
Lesson 20.1 Justifying Circumference and area of a circle
Logs – Solve USING EXPONENTIATION
Chapter 3 Methods.
Exploring Square Roots and Irrational Numbers
Circles: Circumference & Area
Circumference Definition: The distance around a circle. It’s a special word for perimeter. Picture:
Building Java Programs
Chapter 4: Mathematical Functions, Characters, and Strings
JavaScript Basics Stephen Delaney
Java's Math class Method name Description Math.abs(value)
Objective - To round decimals to a specified place value.
Work out 15% of 60.
There are 10 types of people of people in this world…
Functions and Libraries
Building Java Programs
CHAPTER 3: String And Numeric Data In Python
Using Built In Objects Kevin Harville.
Php – Math functions.
មជ្ឈមណ្ឌលកូរ៉េ សហ្វវែរ អេច អ ឌី
To Start: 12 Points Find the following for a circle with radius 5 cm. Leave your answer in terms of π! Diameter = ________ Circumference = ________ Area.
4.3 Arithmetic Operators and Mathematical Functions
Objective 7.03 Apply Built-in Math Class Functions
6.4 – Dividing Decimal Numbers; Square Roots with Decimals
Presentation transcript:

Math class Random() method Floor method Top-level parseInt function JavaScript Math class Random() method Floor method Top-level parseInt function

Math Class Constants and Math Functions Constant Description Actual value Math.E The base of the natural log system 2.718281828459045 Math.LN10 Natural logarithm of 10 2.302585092994046 Math.PI Ratio of circle circumference to diameter 3.141592653589793 Math.SQRT2 Square root of 2 1.4142135623730951 Math.sqrt(x) Square root of x   Math.pow(x, n) Returns x to the power of n Math.log(n) Returns the natural logarithm of n Math.exp(n) Returns e to the power of n

Rounding Functions and Random Numbers Description 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Math.round(x) Rounds to the nearest integer Math.floor(x) Rounds down to the nearest integer Math.ceil(x) Rounds up to the nearest integer Math.random() Random value between 0 and <1   Math.min(a, b, c) Returns the lowest value from list Math.max(a, b, c) Returns the highest value from list

ParseInt function syntax: parseInt( 'string' [, base] ) Semantics: The first argument of parseInt must be a string. The second argument, optional, specifies the number base of the string. The base argument can be any integer from 2 to 36. The function converts a string into an integer. If there is only one argument, the number base is detected according to the general JavaScript syntax for numbers. Strings that begin with 0x or -0x are parsed as hexadecimals; strings that begin with 0 or -0 are parsed as octal numbers. All other strings are parsed as decimal numbers.