Home arrow HTML arrow Page 4 - Adding Scientific Functions to a Web Page Calculator

Adding Scientific Functions to a Web Page Calculator

In this last part of our six-part series, we shall talk about adding scientific functions to our web page calculator, and then conclude. Scientific functions refer to functions like sin(?), cos(?), tan(?), and log(x). The process is not as difficult as you think. The JavaScript interpreter incorporated into many browsers has some built-in scientific functions. It has most of the functions we shall use. However, it does not have some of the functions we shall use. We shall have to code the pair of functions that JavaScript does not have.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
April 08, 2009
  1. · Adding Scientific Functions to a Web Page Calculator
  2. · Coding Summary
  3. · Details of the Scientific Function
  4. · The Global Variables

print this article

Adding Scientific Functions to a Web Page Calculator - The Global Variables
(Page 4 of 4 )

var showNumCalledOnce = false;

This variable is used by the showNum(ID) and operator(ID) function..

var evalString = "";

This variable is used by the removeCalc() and operator(ID) functions.

var memVar = "";

This variable is used by the removeCalc(), showNum(ID) and operator(ID) functions.

var toClearDisplay = false;

This variable is used by the showNum(ID), operator(ID and scienceFn(ID) functions.

var baseExp = false;

This variable is used only by the operator(ID) function.

Your Commercial Project

There are a few things I have not taken into consideration. For example, the number of decimal places for some results may be too long. You have to take this and a few other things into consideration, for you commercial project.

Well, this is the end of the series. I hope you appreciated it. I thank you for reading the series.

DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials