# LaVOZs

The World’s Largest Online Community for Developers

'; Newest 'arithmetic-expressions' Questions - LavOzs.Com

# Questions tagged [arithmetic-expressions]

An arithmetic expression is an expression that results in a numeric value. There are two kinds of numeric values, integers (whole numbers), and real or floating point numbers (numbers containing a decimal point).

• ### I am seeing unexpected and unwelcome behavior with double arithmetic in Java [duplicate]

Ok, JavaSE 1.8 running an application in Eclipse Version: Oxygen.3a Release (4.7.3a) Build id: 20180405-1200. Simple arithmetic: Double dblBalance; ( showing as 2072.41 in debug, but also running ...
• ### Interpret arithmetic expression C++

I am writing a C++ program that reads one line of input from stdin, interpret it as an arithmetic expression (addition and multiplication), evaluate it and write out the result. It can be assumed ...
• ### Does the C++11 standard guarantee that the unary minus of a zero-valued signed integer is zero?

Does the C++11 standard guarantee that the unary minus of a zero-valued signed integer is zero? For example: int zero = 0; int n = -zero; int m = -0; assert(memcmp(&n, &zero, sizeof(int)) == ...
• ### while executing asking for two input values

#include <stdio.h> int main() { int minutes=0; double days=0.0; double years=0.0; printf("enter minutes "); scanf("%d ",&minutes); days= (minutes/60)/24; years=days/...
• ### A program to evaluate arithmetic expression

Here's an interesting problem I haven't managed to deal with yet. Given an arithmetic expression in Reverse Polish Notation, write a program to evaluate it. The expression is given as a list of ...
• ### Defining a left-to-right parser for arithmetic expressions [duplicate]

I'm having a hard time defining a left-to-right arithmetic expression parser in Haskell. What I have done so far is defining a right-to-left parser, following the "G. Hutton, Programming in Haskell" ...
• ### MIT ps1c.py code does not get multiplication rigth

I'm getting a multiplication error in my code (the product gets so much larger than expected). I already searched for similar code that works and they are quite similar to mine. Mine is the following:...
• ### How to prevent divide by ZERO in SQL when multiple tables using in arithmetic expression

I need to perform arithmetic operations using postgres tables. Formula and mapping are given by user and could be anything i.e a+b/(d-e) and there mapping is 'table1+table2/(table3-table4)' I need to ...
• ### How to divide Pandas DataFrame with multiple square root values?

Here is an example of my DataFrame: X Y 4.2 3.0 6.8 4.7 8.4 2.1 I would like implement a formula but ran into some errors. I would like find the value for X squared divided by the summation ...
• ### Problem with Bash Script array arithmetic for simple sine wave generator

I'm fairly new to bash scripting and linux in general. I'm trying to send a series of rapid commands to pressure regulator (half a second apart), which I normally do so with simple square pulse using ...
• ### How to evaluate String as expression to perform arithmetic operations on String in Rust, so that when user type 3 + 1 on console it gives 4

I was trying to make a calculator in the Rust programming language. The calculator performs basic arithmetic operations like add, sutract, exponent etc. The challenging part for me is that the user ...
• ### Doing 198-43 in BCD

To solve this I took the 10s complement of 43, which is 57. Then I tried to add the BCD values of 57 and 198 like this: The right answer is 155 but I got 255. Pretty sure the carry is the problem. I'...
• ### how to evaluate arithmetic operation from string in c++

i am struggling with a string related problem in c++. suppose i have a string s="6*6+4*8+6/6/6-632+81"; My main goal is to do the arithmetic operation from the string. So in the bellow code i am ...
• ### Overload an Arithmetic Operator C++

I have to do the following: In Cash.h, add a declaration inside the Money namespace for an operator overload for the + operation; this should take two Cash operands and return a new Cash value. ...
• ### It is not working as expected. How can i fix this code?

I want the code to increase my semi_annual_income every six months, by making the the semi_annual income increase every six months with by specific percentage. so it was suppose to be according to my ...