Questions tagged [operations]
298 questions
0
votes
3 answers
Java: Addition of integers with parentheses
Consider the two following lines of code:
System.out.println((1 + (1 - 1)) / 2);
System.out.println(1 + (1 - 1) / 2);
This is the output that I get:
0
1
Why is this the case? Does Java arithmetic follow PEMDAS rules?

mpmp
- 2,409
- 4
- 33
- 46
0
votes
3 answers
Java bitwise operations return "wrong" value
---EDIT: I am not allowed to use any packages, or prewirtten methods. And no worries, i don't want you to make my "homework", i just need a little hint!---
I found these interesting Algorithms. I want to use the method bitwiseAdd. My problem is,…

Cortex
- 1
- 1
0
votes
1 answer
Computing time in relation to number of operations
is it possible to calculate the computing time of a process based on the number of operations that it performs and the speed of the CPU in GHz?
For example, I have a for loop that performs a total number of 5*10^14 cycles. If it runs on a 2.4 GHz…

user3764418
- 13
- 1
0
votes
1 answer
Assembly substraction
Hello i started to learning basic 6502 assembly. Unfortunately i encountered first problem. I put code here and my opinion's what's doing what.
> LDA #$5 <-- we put value $5 in register A(accumulator) STA
> STA$01 <-- we store…

user3402584
- 410
- 4
- 8
- 18
0
votes
1 answer
matrix multiplication and summation
i'm currently trying to remake my old function which takes a fixed value x:
function [res] = Eph(x,approximation,dot)
a = [ 0.1818 0.5099 0.2802 0.02817];
b = [ 3.2 0.9423 0.4029 0.2016];
if dot ~= 1
res = sum(a.*exp(-b.*x));
Now I'm…

greyxray
- 362
- 2
- 12
0
votes
1 answer
My sml compiler doesnot recognize simple operations on arrays (update(arr,int,int), array(int,int) etc). Help!
I installed the sml interpreter from here : http://www.smlnj.org/, I used the self extracting .EXE for windows. (I'm running windows7 64 bit)
Although simple operations on basic datatypes are working, it is not recognising operations on…

shubh
- 1
- 1
0
votes
1 answer
GLPK multiple dimension param
How do I use param Distance as following in GLPK? like param Distance {line in Line, dir in Direction , ori in Station , des in Station};?
data;
set Direction := Eastbound Westbound;
set Line := District Piccadilly;
set Station := ACTON_TOWN…

Baisheng
- 1
- 1
0
votes
2 answers
batch sqlcmd using greater than / less than operands
I am trying to generate a pretty basic SQL output data set using SQLCMD in a batch process where the content is filtered by the date of each record being between two values populated in a separate work file. Those values were loaded into the…

Jerry S
- 1
0
votes
2 answers
JS - summing elements of arrays
I'm trying to make operations with numbers that are stored in arrays, unfortunately they seem to be considered as "text" rather than numbers, so when I do like array1[i] + array2[i], instead of doing 2+3=5 I would get 2+3=23 ...
The values of these…

Zizi
- 11
- 2
0
votes
1 answer
how to count primitive operations in a while loop in best and worst case?
I understand how to do the for loop but a while with two statements i am not sure.
while ( i >0 and x< A[i-1])
maybe break it down into two if statements?
if i>0
if x

gds hgff
- 1
- 1
0
votes
1 answer
How to calculate the number of operations for the opencv Gaussian filter function?
By checking the source code of opencv, there are sub-functions and some sub-functions further in sub-functions, generally how can we get to know how many operations in total of does this function need and how many times of memory read and write we…

sean
- 51
- 6
0
votes
3 answers
Fixing a method and parameter error
Okay, so I just started this homework lab and I'm having a little bit of trouble. I've searched for any solutions but they all seem way more complex than what I can comprehend. I'm looking for the dollars needed and change needed to buy something. I…

Junior110697
- 3
- 1
0
votes
1 answer
Using PHP to measure and alter MySQL fields but changes are incorrectly stored/displayed
The concept of my game relies on the fact that if you do not log in to take care of your pet, the pet will 'die'. Currently this is my code to measure the time past and to apply the negative modifiers to the pet's mood, hunger, and cleanliness…

Gabrielle Taylor
- 13
- 2
0
votes
1 answer
How can i track the android phone operations internally?
I want to develop a mobile app that stores all user operations like clicking, selecting, swiping, and closing apps into a database. I have to store the button name, id and time of the operation.
How can I track that in Android without disturbing…

Nava2011
- 195
- 1
- 15
0
votes
1 answer
Setting a variable to an operator then executing it
I'm new to PHP in general. I was messing with this code until I wanted to execute the function in one set instead of having to set and add, sub, div, mult function. How do I go about setting the variable operator with the two num sets?
Example…

Philslair
- 3
- 1