calculator

Simple GUI Java calculator [closed]

╄→гoц情女王★ 提交于 2019-12-08 01:24:26
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I am building a simple GUI Java calculator. I have an issue finding a package or figuring out a method to do the actual calculation. So far I've figured

CommandLine Java Calculator

泄露秘密 提交于 2019-12-07 14:11:58
问题 I've just learned java but from my old experience coming from C++ i tought that i can write a commandline calculator wich supports all 4 basic operators with just one line. But i am having a bit of problem. This is my code: import java.util.Scanner; public class omg { public static void main(String args[]) { int fnum,snum,anum = 0; String strtype; //The original calculation as string char[] testchar; //Calculation as chararray char currentchar; //current char in the char array for the loop

Best coding language for dealing with large numbers (50000+ digits)

有些话、适合烂在心里 提交于 2019-12-07 07:23:55
问题 Can you recommend good languages to do math with large numbers in? So far I've used Actionscript 2 and Objective-c and with Objective-c even using NSDecimalNumbers I was limited to 32 digits in my calculations... I would need at a minimum to be able to calculate with numbers fifty-thousand digits long. 回答1: Perhaps Haskell will appeal to you. 回答2: Python has arbitrary-length integers and uses them transparently, so you don't need any special code or classes for this. >>> len(str(math

How can I accept negative values in Postfix and Infix Notation?

十年热恋 提交于 2019-12-07 03:27:25
I've written a few methods for a calculator. One, which evaluates an entered Postfix expression and another, which transfers an entered infix expression into a postfix expression. Both these methods allow multi digit integers aswell as floats for the number input types. Now for my question: I want to include the negative input in both these methods e.g. Infix: "3 * (-1)". However I'm kinda lacking an idea on how to implement this problem. Maybe someone can give me ideas or code examples. I'm including both methods below. A few simple methods are used in them which aren't shown here, but most

How to handle keyboard in real mode through BIOS interrupts?

混江龙づ霸主 提交于 2019-12-07 02:54:57
问题 I have to code for a operating system on which I can run a calculater.It is like a desktop calculater. For this I am reading the brokenthorn operating development series I have completed the second stage of bootloader The bootloader is in real mode. After this the author is explaining the protected mode. I don't want to use the protected mode. I don't have time for that. So I want to write the calculater in real mode by using bios interrupts. Is it possible? I think it can be written on the

Expression Simplification Algorithm

半世苍凉 提交于 2019-12-06 12:13:26
I'm currently working on a Calculator app and I want output to be in both a simplified expression and decimal answer form. An example would be sqrt 2 * sqrt 3 = sqrt 6 which can also be outputted as 2.44948... What is the best approach to this and is there any well-established algorithms to do this? Yes. What you likely want is a computer algebra system , which understands formulas as artifacts to be manipulated by explicit mathematics rules. Mathematica and Macsyma are applications which do this. However, these are quite sophisticated systems and it is not easy to see how they "work". What

Trying to Calculate logarithm base 10 without Math.h (Really close) Just having problems with connecting functions [closed]

最后都变了- 提交于 2019-12-06 11:32:48
Closed . This question needs details or clarity . It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post . Closed 3 years ago . I'm trying to learn how to calculate the logarithm base 10 of any numbers that I enter via scanf to my code. I figure that I could calculate the ln(a) a being the number input. I have a working code that calculates this; however now i just want to divide any numbers that my ln(a) code outputs by the defined LN10. This is because the natural log of a number divided by the natural log of 10 will

Simple Calculator with multiple operations - Android

烈酒焚心 提交于 2019-12-06 11:00:36
问题 I have created a simple calculator that calculates two inputs (ex. 2 + 2 = 4). What I want to do now is to make the app to calculate multiple operations like (ex. 2 + 2 * 4 - 1 = 15). Can someone help me with my code? Here is my code. public class MainActivity extends Activity { public String str =""; Character op = 'q'; int i,num,numtemp; EditText showResult; String displayStr = ""; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView

Simple GUI Java calculator [closed]

ぐ巨炮叔叔 提交于 2019-12-06 08:29:27
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center . Closed 6 years ago . I am building a simple GUI Java calculator. I have an issue finding a package or figuring out a method to do the actual calculation. So far I've figured that when I do a math operation, the number in the text box gets saved in a temporary location. Then

CommandLine Java Calculator

别说谁变了你拦得住时间么 提交于 2019-12-05 23:22:56
I've just learned java but from my old experience coming from C++ i tought that i can write a commandline calculator wich supports all 4 basic operators with just one line. But i am having a bit of problem. This is my code: import java.util.Scanner; public class omg { public static void main(String args[]) { int fnum,snum,anum = 0; String strtype; //The original calculation as string char[] testchar; //Calculation as chararray char currentchar; //current char in the char array for the loop int machinecode = 0; //Operator converted to integer manually String tempnumstr; //first and second