HTML
  Home arrow HTML arrow Adding Scientific Functions to a Web Page ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Adding Scientific Functions to a Web Page Calculator
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-04-08

    Table of Contents:
  • Adding Scientific Functions to a Web Page Calculator
  • Coding Summary
  • Details of the Scientific Function
  • The Global Variables

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Adding Scientific Functions to a Web Page Calculator


    (Page 1 of 4 )

    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.

    The layout

    This is the picture of our calculator with buttons for scientific functions:


    Fig. 6.1 Scientific Calculator


    I have included 10 scientific functions. A physical calculator has more. When you complete this series, you will be able to add the other functions. Each button for a scientific function has the identification or the abbreviated name of the particular function.

    There are two rows of the scientific buttons. These rows are above the standard buttons. This is the HTML code for the scientific buttons in the calculator DIV element:


    <button type="button" class="CalcBut" id="BSI" onclick="scienceFn('BSI')">sin</button><button type="button" class="CalcBut" id="BCO" onclick="scienceFn('BCO')">cos</button><button type="button" class="CalcBut" id="BTA" onclick="scienceFn('BTA')">tan</button><button type="button" class="CalcBut" id="BLN" onclick="scienceFn('BLN')">ln</button><button type="button" class="CalcBut" id="BLO" onclick="scienceFn('BLO')">log</button><br />

    <button type="button" class="CalcBut" id="BYX" onclick="operator('BYX')">y<sup>x</sup></button><button type="button" class="CalcBut" id="BSQ" onclick="scienceFn('BSQ')">sqrt</button><button type="button" class="CalcBut" id="BX2" onclick="scienceFn('BX2')">x<sup>2</sup></button><button type="button" class="CalcBut" id="BEX" onclick="scienceFn('BEX')">e<sup>x</sup></button><button type="button" class="CalcBut" id="BRO" onclick="scienceFn('BRO')">Rnd</button><br />


    These tags are just above the tags for the standard buttons.

    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek