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

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 / 2
April 08, 2009
TABLE OF CONTENTS:
  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
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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