GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing maker.makecode.com — Math MathUsing numbers, number operators, and math functions. Numeric values: 0, 1, 2, 6.7, 10.083...Just numbers by themselves. Sometimes these are called numeric literals. Integers: whole numbersFloating point: numbers with a fractional partNumbers can have their fractional part too. The decimal point is between the digits of the number. But, floating point numbers have the decimal point at any spot between digits, like: 3.14159 or 651.75. Arithmetic binary operation (+, -, *, /)The operations for basic arithmetic: add, subtract, multiply, and divide. Remainder (%)This is a extra operator for division. You can find out how much is left over if one number doesn't divide into the other number evenly. We know that 4 / 2 = 2, so 2 divides into 4 evenly. But, 5 / 2 = 2 with a remainder of 1. So, the remainder operation, 5 % 2 = 1, gives the number that's left over from a division operation. Exponent (**)The exponent operator will multiply the number on the left by itself for the amount of times of the number on its right. That is, 4 ** 2 = 4 * 4 and 2 ** 3 = 2 * 2 * 2. The area of a square that has sides with a length of But using the exponent operator, this is the same as: The volume of a cube is three sides multiplied together. The two volumes are the same: Integer multiply and divideInteger multiply and divide treats the two numbers it operates on as integers. If there is a fractional part for a number, it is truncated before it is used with the other number. The resulting value is always an integer too. imulInteger multiplication of two numbers idivInteger division of two numbers Square rootThe square root of a number is another number that when multiplied by itself it becomes the original number. You know that Absolute valueWhen you want to know how much a number is without its sign (+/-). The absolute value of -5 is 5 and the absolute value of 5 is also 5. The absolute value is sometimes called the magnitude. Minimum and maximum of two valuesYou can get the smaller or the bigger of two numbers with the min and max functions.
RoundIf a number has a fractional part, you can make the number change to be the closest, next integer value. This is called rounding. Rounding the number For negative numbers, they round toward the absolute value (the absolute value of CeilingTo make a number change to the next higher whole number (integer), get the number's ceiling value. The ceiling value for FloorTo make a number change to the next lower whole number (integer), get the number's floor value. The floor value for TruncateThe fractional part of a number is removed by truncating it. If a number has the value Random valueMake up any number from a minimum value to a some maximum value. If you want a random number up to 100, say: Math.randomRange(0, 100). See alsoabs, min, max, randomRange |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |