From: John Corbett
Date: Wednesday 04 April 2001 2:49 PM
Question: Any codes for designing a scientific calculater in
There are the Sin()
(tangent) and Log() (logarithm) functions that you could use. E.g:
var2 ^ 2
var1 = 10
var2 ^ var3
var2 ^ (1 / var3)
If I have missed something out, tell me what and I will try and
find out how it works.
comments powered by Disqus. blog comments powered by
Date: Tuesday, May 10, 2011 at 21:16:45
Comments: That was helpful.Thanks
Arun Anoop M
Date: Saturday, June 5, 2010 at 16:34:26
Comments: Simple Calculator
'By Arun_MTech IT(mattanur,Kannur).
public sub command1_Click()
Instead of "sin" we can use tan,cos,sqrt,log.
dim i as
'dim a as integer//declare 1st of the program
'dim f as flag//declare 1st of the program a=text1.text
for i=1 to a
Nice web site.This site will people who are beginner.
Date: Wednesday, February 3, 2010 at 10:16:43
Comments: nice! workful 2 all students.....and thanks
Date: Wednesday, December 16, 2009 at 14:15:00
Comments: 1/x has a bug if your number is 88 and you press you function 1/x and
press it again it will not go back to no 88
Date: Tuesday, October 20, 2009 at 01:08:35
Comments: thank you for this good work
Date: Friday, July 24, 2009 at 18:50:08
Comments: this was very much interesting & i got many information from it .its
very useful& very good
Date: Tuesday, June 2, 2009 at 16:41:08
Comments: this is a good site i like it sosvery much
Date: Friday, May 1, 2009 at 01:26:22
Comments: thanks to all. you helped me alot with my project
Date: Thursday, February 12, 2009 at 22:07:28
Comments: you guys are really helping the world kudos too u all
Date: Wednesday, November 5, 2008 at 18:32:49
Comments: i wanted a simple calculator for 8th
Date: Monday, October 27, 2008 at 08:00:53
Comments: good Very goooooood
Date: Thursday, September 18, 2008 at 11:24:02
Comments: i like this side thanku
Date: Thursday, August 21, 2008 at 08:01:41
Comments: now i am reading this ...................
but it is nice
Date: Wednesday, July 30, 2008 at 14:05:40
Like a above space my mind is empty.
but after reading this page i got some idea.
that's really helpfull in my vb project.
From: sundarapandian <pms_sarath>
Date: Tuesday, July 29, 2008 at 09:54:46
Comments: thanking you sir
Date: Tuesday, July 29, 2008 at 07:20:25
Comments: Very Very Informative
Date: Thursday, January 3, 2008 at 09:56:54
Comments: hi...thanks a lot...i've got my backspace work because of this site. .
Date: Friday, October 19, 2007 at 03:10:23
Comments: lol i tried to use the inverse functions, but they just dont match the
results i get from a calculator... i mean arcsin(0.5) should be 30, but i
keep getting something like 0.4 or some decimal... and its never over 1
O_o can u tell me whats wrong??? ty~
The following code should help you to work out sine and inverse sine.
First, create two buttons - cmdSine and cmdInvSine and then enter the
Dim pi As
Private Sub Form_Load()
pi = 4 * Atn(1)
Private Sub cmdSine_Click()
x = 30
x = x * pi / 180
x = Sin(x)
Private Sub cmdInvSine_Click()
x = 0.5
x = Atn(x / Sqr(-x * x + 1))
x = x * 180 / pi
Pi is calculated in Form_Load. As mentioned in the MSDN library:
The Sin function takes an angle and returns the ratio of two
sides of a right triangle. The ratio is the length of the side opposite
the angle divided by the length of the hypotenuse.
The result lies in the range -1 to 1.
To convert degrees to radians, multiply degrees by pi/180. To
convert radians to degrees, multiply radians by 180/pi.
Therefore, to get the same result as a calculator for the Sin function,
the number must first be converted into radians by multiplying it by pi
and then dividing by 180.
For inverse sine, the result of the function from the 'Derived Math
Functions' page of the MSDN library for calculating inverse sine must be
multiplied by 180 and then divided by pi.
The Cos and Tan functions should work in the same way and inversely by
using the appropriate function from the 'Derived Math Functions' page of
the MSDN library (see further down this page).
Date: Wednesday, October 3, 2007 at 05:07:11
Comments: the presentation of codings are well implemented and easy to understan
Date: Thursday, April 19, 2007 at 05:56:35
Comments: Hopefully this will work for me. Thanks for your informtin and sharing
Date: Thursday, March 1, 2007 at 07:16:49
Comments: your site is really cool!it really helped me to do my scientific calculator. thanks for the functionS!
suresh kumar jetty
Date: Monday, February 5, 2007 at 08:32:19
Comments: its a nic e and simple way to learn the important codes.
Date: Monday, January 8, 2007 at 23:45:50
Comments: i was realllly hoping that i could use a calculater on yhis website. im in a hurry so i have to do my hw now! i didnt bring my scientific calculater home with me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!poooo!
You need Visual Basic 6.0 to be able to open the calculator projects.
Date: Tuesday, January 2, 2007 at 19:17:57
very exellent your site.
Date: Tuesday, November 7, 2006 at 07:14:40
this is a cool site for us vb starters... tnx to the author of this site..
Date: Saturday, July 8, 2006 at 10:00:46
I'm so glad that I did have visited your website....It really help me somehow....Tnx!
From: shailendra <shailendra_pgdca@reddiffmail>
Date: Monday, June 5, 2006 at 15:32:34
Clipboard.SetText txtDisplay.Text 'change to
whatever the display control is
Date: Wednesday, May 17, 2006 at 17:44:34
Comments: The self explanatory code has helped me a lot for my project pliz keep it up. Pli try to send me other codes. You a star.
Date: Friday, April 21, 2006 at 10:15:43
Comments: your site is very helpful.May you send me a scientific calculator using Visual Basic 6.0.
Date: Wednesday, April 19, 2006 at 18:43:55
Comments: Thank you for the Calculators, I used some of the codes
for my oun calculator, I hope you don't mind,
Thanks Alot Man.
Date: Wednesday, April 12, 2006 at 21:57:16
Comments: this is very interesting info i'm so glad i found this web site
Date: Tuesday, April 4, 2006 at 11:46:36
Comments: i like the way you give your explanation.for the sake of people like me could you give the code of a standard calculator using visual basic 6.0 in microsoft word as we don't have visual basic in my PC
Here is the document. A picture of the Form is included at the
jupet na malupit
Date: Friday, January 7, 2005 at 06:12:54
Comments: youre are too simple but it helps me up to make my own program next time i will become a computer wizard..........
Date: Thursday, March 4, 2004 at 14:28:08
Comments: i dont that the calculator has follow same priority.i want the program that has brackets for priority.
guada,sherly,ema and lea
Date: Monday, March 1, 2004 at 04:16:27
Comments: pls help us with our final requirement in infotech...
Final Requirement in Info Tech. we have been researching but do not have the idea about the codes.. and imagine we're going to submit ti this week.. here's the
1. Create a program that will execute the calculator as shown below. Instead of the basic mathematical operators shown in the calculator below, change them to calculate square root, and conversions to hexadecimal and octal, and the factorial.
2. The program uses arrays, specifically using index for the buttons of numbers, index for the buttons of the square root, hexadecimal and octal, and the factorial.
3. The edit menu is left not to function.
4. The calculator can be executed at the desktop.
Date: Thursday, February 26, 2004 at 16:21:20
Comments: can u give me an example of a calculator program in visual basic that can solve functions and can evaluate it such as -> x+y+27=0, given: f(x)=3... something like this, and also can solve quadratic equations and also codes on how to create a graph out of an equation... pls. i really nid it ASAP coz the deadline of our project is 2 weeks from now and I still dont know how to create one... THANKS..
Date: Wednesday, February 18, 2004 at 17:24:05
Comments: will you plz help me with the codings of tangent,squre root,cube root,x cube,x squared and the tan-1...plz rep asap and kindly explain to me what are the meaning of them..and what is the meaning of calcmen?plz help me for my project that will be pass this friday..thanks...
Date: Thursday, February 12, 2004 at 09:43:16
Comments: thank you for the info.about the source code of calculator.
but i think you a lot more to developed this code....
Date: Wednesday, February 4, 2004 at 18:37:49
Comments: i want to make a scientific calculator in vb.
it should be able to do dy by dx annd factorial .
can you sent me sample program
bala & vijay
Date: Friday, January 16, 2004 at 09:32:28
Comments: Thank u for ur vb calc program
Date: Tuesday, December 9, 2003 at 12:27:43
Comments: For my Calculator project, what kind of code will i enter to copy the number.
If you want to copy it to the clipboard, try this code:
Clipboard.SetText txtDisplay.Text 'change
to whatever the display control is
Date: Monday, December 1, 2003 at 23:02:26
Comments: Can you help me I cannot work out the the code for to convert a number in to Binary and into Hex can any one help
me with this problem
Date: Tuesday, November 25, 2003 at 21:38:45
Comments: i want to make calculator by vb i trid more & more its difficult but i have it homowork ineed help pleas...........
Date: Friday, November 21, 2003 at 08:10:03
Comments: im doing a scientific calculator and a program.... can u pleas e help me in this calculation the formula is X raise to the y for example how can 3 raise 0.387 function? please help me ASAP i have to finished dis progrm thank
Use the exponentiation character - '^' e.g.:
Date: Wednesday, November 12, 2003 at 14:09:45
Comments: A program Code change hex to dec,dec to hex,dec to bin,bin to dec, oct to dec ,dec to oct and calculate square root
Thank you very much
You can use the Int, Hex and Oct functions for this.
From: nikhil <engg_nikhil84>
Date: Monday, October 20, 2003 at 14:55:16
Date: Wednesday, October 15, 2003 at 18:14:57
i have to make a scientific calculator.but i dont know about its oprator.so please sir help me in this matter.
Date: Monday, September 15, 2003 at 08:58:37
Comments: hello brother...i found this wonderful cal code...i thought you would like to see it...i love you
Date: Friday, September 12, 2003 at 05:04:27
Comments: what function can i formulate to get the Arctan and arcos?
The following is available from the MSDN Library and should help you:
The following is a list of nonintrinsic math functions that can be derived from the intrinsic math functions:
Sec(X) = 1 / Cos(X)
Cosec(X) = 1 / Sin(X)
Cotan(X) = 1 / Tan(X)
Arcsin(X) = Atn(X / Sqr(-X * X + 1))
Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
Arcsec(X) = Atn(X / Sqr(X * X – 1)) + Sgn((X) – 1) * (2 * Atn(1))
Arccosec(X) = Atn(X / Sqr(X * X - 1)) + (Sgn(X) – 1) * (2 * Atn(1))
Arccotan(X) = Atn(X) + 2 * Atn(1)
HSin(X) = (Exp(X) – Exp(-X)) / 2
HCos(X) = (Exp(X) + Exp(-X)) / 2
HTan(X) = (Exp(X) – Exp(-X)) / (Exp(X) + Exp(-X))
HSec(X) = 2 / (Exp(X) + Exp(-X))
HCosec(X) = 2 / (Exp(X) – Exp(-X))
HCotan(X) = (Exp(X) + Exp(-X)) / (Exp(X) – Exp(-X))
Inverse Hyperbolic Sine
HArcsin(X) = Log(X + Sqr(X * X + 1))
Inverse Hyperbolic Cosine
HArccos(X) = Log(X + Sqr(X * X – 1))
Inverse Hyperbolic Tangent
HArctan(X) = Log((1 + X) / (1 – X)) / 2
Inverse Hyperbolic Secant
HArcsec(X) = Log((Sqr(-X * X + 1) + 1) / X)
Inverse Hyperbolic Cosecant
HArccosec(X) = Log((Sgn(X) * Sqr(X * X + 1) + 1) / X)
Inverse Hyperbolic Cotangent
HArccotan(X) = Log((X + 1) / (X – 1)) / 2
Logarithm to base N
LogN(X) = Log(X) / Log(N)
You can see the above here:
Date: Thursday, September 11, 2003 at 09:57:27
Comments: the page is very helpful but can u please send a simpler or beginners version for calculator.Not like the one that is given here cos i am not being able to understand what is lastinput= "NUMS" and lastinput ="NEG" y is it used please do explain i am new comer to vb
The LastInput variable in the Standard calculator project is used to hold
what the last button pressed was. "NUMS" means a numerical
key was last pressed and "NEG" means the minus key was last
Date: Friday, September 5, 2003 at 11:08:50
Comments: hi! i really love math and i got 92 in our math subject by the help of scientific calculater but i have some problem i dont know what is the meaning of In in scientific
Date: Tuesday, September 2, 2003 at 05:11:46
Comments: please show me how to make the calculator as dec hex oct.please i really need it in makng my project
Please see the following table for conversion between normal,
hexadecimal and octal numbers:
For example, if you wanted to convert a hexadecimal number to an
octal number, you would use the following code:
var1 = Oct(&HB7)
'returns &O267 as
From: hazel <baby_hazel>
Date: Saturday, August 30, 2003 at 05:38:26
Comments: more info
Date: Thursday, August 28, 2003 at 20:34:43
Comments: well...ppl..ill b really glad if u help with the code in designing a scientific calculator..only with..binary complement,xor,+ and - in vb6.0
plz help guys!
Date: Friday, July 18, 2003 at 03:05:49
Comments: I am trying to write code for a calculator. I cannot get the add button to add properly.
I looked at the sample program and I am not using a control array (Not doing an array at all).
Date: Monday, July 7, 2003 at 07:52:31
Comments: to find how a scientific calculator can help in solving number system arimeties calculations?
Date: Thursday, June 12, 2003 at 20:39:20
Comments: MORE INFO PLEASE
Date: Friday, June 6, 2003 at 19:48:56
Im building a Scientific Calculator for my tech class and need help on making a 1/X button.
Can anyone help me?
1/X means 1 divided by X. This can be done with this code:
txtDisplay.Text = 1 / txtDisplay.Text
to whatever the display control is
Date: Monday, June 2, 2003 at 16:08:34
Comments: i really, really need help designing a calculator for my visual basic class. it's a regular four function calculator, but it also has the trig functions and square root. i need help cuz i don't know what the hell i'm doing and this damn thing is due next monday. help!
Date: Monday, June 2, 2003 at 00:02:07
Comments: I need a code for calclautor like the calclautor in windows system .. I mean that I can use the keyboard or I can write 1 + 1 in the result screen then I press Enter >> the result will be 2
Date: Wednesday, April 30, 2003 at 23:23:23
Comments: Can u Pls help me out with the Shanon and Nyquist Calculator program in Visual Basic.
The formula is
R=B*log2M <= 2W*log2M
Date: Saturday, March 29, 2003 at 09:23:34
Comments: hello... this article of urs is very nice... by the way i need some help i have a research project given by out proffesor about the visual basic 6.0 virsion and he wanted us to make a code for a basic calculator could u please help me... thank u so much... the basic calculato would have addition subtraction divission and multiplication functions only i do really apprecial the help thank u
Date: Wednesday, March 12, 2003 at 17:03:41
Comments: could u plz help me.. my corsework task is to complete a 60 digit calculator but i can not get the subtract button to work could u plz help
Date: Monday, March 10, 2003 at 23:08:57
Comments: Hi, I have to create a scientific calculator. I got the add to work. How do I get a backspace to work. To edit a single no? thanks in advance
You should just be able to remove the last character from the display
with this code:
txtDisplay.Text = Left(txtDisplay.Text, Len(txtDisplay.Text) - 1)
to whatever the display control is
Catherine E. De Jesus
Date: Tuesday, March 4, 2003 at 16:21:40
Comments: A program code for MS; MR; M+; 1/x; square root; +/- in a scientific calculator
Reply: To give the calculator memory, you just declare a variable for
it. After that, use this code:
MS (memory clear?):
txtDisplay.Text = calcmem
to whatever the display control is
calcmem = calcmem + txtDisplay.Text
Date: Wednesday, February 5, 2003 at 10:21:32
Comments: step by step for the square root calculator with
Reply: The Sqr function works out the square root of a number
Date: Tuesday, December 31, 2002 at 03:54:29
Comments: How can i find sin inverse function in visual basic ?
The code you need for an inverse sine function is:
Function ArcSin(X As
Double) As Double
ArcSin = Atn(X / Sqr(-X * X + 1))
Date: Saturday, December 21, 2002 at 17:24:39
Comments: Would you be able to give me the basic codes for a calculator in VB 6.0.
Like adding and subtracting dividing etc. Thanks
Date: Tuesday, December 17, 2002 at 12:44:53
Comments: It is very simplified explaination. Thank you very much
Martin Allen 1999 - 2013. Last updated
Tuesday 08 January 2013 08:52:15 PM -0000.