|
Functions for Basic Math
| Language: |
JavaScript |
Unrated
Rated by 0 Users
1 Star = Horrible 5 Stars = Perfect
Rate Code Now
|
| Posted By: |
Blake |
| Author Website: |
Differences between ASP and PHP |
| Posted On: |
8/28/2007 |
| Code Views: |
592 |
This just creates the functions mmAdd, mmSubtract, mmMultiply, and mmDivide to do basic math problems. This is really more of an example for syntax.
|
function mmAdd(inNum1,inNum2){ return (inNum1 + inNum2); }
function mmSubtract(inNum1,inNum2){ return (inNum1 - inNum2); }
function mmMultiply(inNum1,inNum2){ return (inNum1 * inNum2); }
function mmDivide(inNum1,inNum2){ return (inNum1 / inNum2); }
// Example output method: document.write("The sum of 1 and 2 is: " + mmAdd(1,2));
View code in Textarea
This code has not been tested by Your WebCode. Use it at your own risk.
Please report any copyright violations.
|
|