Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: skillrepos/calc3
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: joshipm/calc3
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 7 commits
  • 1 file changed
  • 4 contributors

Commits on Sep 5, 2012

  1. add max function

    sasbcl committed Sep 5, 2012
    Copy the full SHA
    d003b91 View commit details
  2. add exp function

    sasbcl committed Sep 5, 2012
    Copy the full SHA
    482365d View commit details
  3. add min function

    sasbcl committed Sep 5, 2012
    Copy the full SHA
    3753e5a View commit details
  4. add avg function

    sasbcl committed Sep 5, 2012
    Copy the full SHA
    b372aa6 View commit details

Commits on Apr 14, 2022

  1. Create README.md

    brentlaster authored and joshipm committed Apr 14, 2022
    Copy the full SHA
    08a4dfb View commit details
  2. Update README.md

    techupskills authored and joshipm committed Apr 14, 2022
    Copy the full SHA
    4e3c85e View commit details
  3. Copy the full SHA
    4330aa3 View commit details
Showing with 19 additions and 3 deletions.
  1. +19 −3 calc.html
22 changes: 19 additions & 3 deletions calc.html
Original file line number Diff line number Diff line change
@@ -4,13 +4,17 @@

<script language=javascript type="text/javascript">

var plus,minus,divide,multiply
var plus,minus,divide,multiply,max,pow,min,avg

function initialize(){
plus=document.calc.operator.options[0]
minus=document.calc.operator.options[1]
divide=document.calc.operator.options[2]
multiply=document.calc.operator.options[3]
max=document.calc.operator.options[4]
pow=document.calc.operator.options[5]
min=document.calc.operator.options[6]
avg=document.calc.operator.options[7]
}

function calculate(){
@@ -23,7 +27,15 @@
if (divide.selected)
document.calc.answer.value = a / b
if (multiply.selected)
document.calc.answer.value = a * b
document.calc.answer.value = a * b
if (max.selected)
document.calc.answer.value = Math.max(a,b)
if (pow.selected)
document.calc.answer.value = Math.pow(a,b)
if (min.selected)
document.calc.answer.value = Math.min(a,b)
if (avg.selected)
document.calc.answer.value = (a + b) / 2
}

</script>
@@ -44,12 +56,16 @@ <h2>Calc</h2>
<option value=minus>-
<option value=divide>/
<option value=multiply>*
<option value=max>max
<option value=pow>**
<option value=min>min
<option value=avg>avg
</select>

<input type=text name=val2 size=10>
=
<input type=text name=answer size=10>
<input type=button value=answer onClick="calculate()">
<input type=button value="show answer" onClick="calculate()">
</form>

<br><br>