GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javascript/numbers/operators.md at master · octatone/javascript

Expand file tree

/

operators.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
39 lines (27 loc) · 676 Bytes
/

operators.md

Copy path

File metadata and controls

39 lines (27 loc) · 676 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

Operators

You can apply mathematic operations to numbers using some basic operators like:

  • Addition: c = a + b
  • Subtraction: c = a - b
  • Multiplication: c = a * b
  • Division: c = a / b

You can use parentheses just like in math to separate and group expressions: c = (a / b) + d


Create a variable x equal to the sum of a and b divided by cand finally multiplied by d.

var a = 2034547;
var b = 1.567;
var c = 6758.768;
var d = 45084;

var x =
var a = 2034547;
var b = 1.567;
var c = 6758.768;
var d = 45084;

var x = ((a + b) / c) * d;
assert(x == (((a + b) / c) * d));

You are visitor 01402792 — 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.