Monday, June 13, 2011

Firefox tips


Add Status-Bar Scientific Calculator To Firefox


It is a firefox addon that creats a small textbox for evaluation mathematical expressions and more.
Click on the icon on the statusbar to display the textbox. Enter the expression to calculate and hit enter to evaluate.
Steps to Follow
Download the  Status-Bar Scientific Calculator to Firefox from here

Custom Functions

Custom functions can be defined in javascript using the options window.
A function name should be in lower case alphabets only. The expression should be in javascript any not in the way used in the calculator directly. For ex. for using sin() function use Math.sin. The function should always return a valid number. For defining reurssive function, dont use self-reference, instead define a tempory function inside the function and use self-reference in the temporaty function. For ex.
recur = function(a) {test = function(n){ if(n<=0) return 1; else return n*(test(n-1)); }; return test(a); }
Constants
Contants can be used to make expressions smaller and understandable.
Some predefined constants are e(Natural log base), pi, and ans (value of the last expression evaluated). Few other constants are provided which can be manager through constants manager(add/edit/delete).
Temporary Variables
Temporary variables can be defined in the calculator itself using expressions like:
a=2+3*sin(pi/2)
A temporary variable should be of the form: a lower case alphabet followed by zero or more lowercase alphabets, numbers or underscore(_).
Temporary variables last for the session, they can be redefined but not deleted during the session.
Modulo/Percent
The '%' operator can be switched between:
Modulo: calculates remainder on division
eg: 100%6=4, -5%3=-2

No comments:

Post a Comment

Pages

Categories