Most voted "mathematics" questions
Mathematics is the science of logical and abstract reasoning that studies quantities, structure, measurements, spaces and variations. Any math questions on this site should be related to programming.
Learn more…369 questions
Sort by count of
-
4
votes2
answers581
viewsLocation of a point within the arc range
I’m looking for a Javascript function that returns a random value within a range in the area of a circle. The interval would be along the radius with distances equivalent to the center point and the…
-
4
votes2
answers1045
viewsCalculation to determine whether triangle is rectangle gives no expected result
The program I created takes three integer values, calculates within the if these values and if the condition is correct it should show on the screen the YES (the triangle is rectangle), and if the…
-
4
votes1
answer812
viewsHigher value in an array in PHP
I’m having a problem finding the highest value of the box width of the products for shipping a site I’m doing. I put the data of the products with the size of the boxes in the database and I am now…
-
4
votes2
answers2404
viewsCalculate mathematical expression in string
Hello, I would like to know how to calculate a mathematical expression, contained in a string, in Javascript. Example: calc = "(7*2+1)/2"; How could I calculate?
-
4
votes3
answers847
viewsFactorial is not being calculated
Make a program to read an array A of type vector with 15 elements. Construct an array B of the same type, each element of matrix B being the factorial of the corresponding element of matrix A .…
-
4
votes1
answer368
viewsOverflow by multiplying two integers in Biginteger
I am starting studies in Java and have a task: generate two random integers and store their multiplication. For this, I tried to use long and BigInteger. But the result of this multiplication is…
-
4
votes1
answer133
viewsHow to lease value without pennies down?
How to round values that have no pennies and only have numbers? Ex: 10, 20, 30, 40, 50. If person is 13, stay 10, if 25 becomes 20.
-
4
votes1
answer2062
viewsExponentiation operator in C++
About a question recently asked and answered: there is some reason - historical or not - why C++ (as well as many other programming languages) does not include an operator for exponentiation? For…
-
4
votes1
answer753
viewsHow to Classify a Triangle
I want to classify a triangle as to the sides, being that a triangle with all equal sides is designated Equilateral, with all different sides being designated Escaleno and if it has only two equal…
-
4
votes1
answer376
viewsComparison of Bigdecimal result with Float (Java)
I have two formulas implemented, one with the Bigdecimal type and the other with the primitive double type, but the results differ and I am not able to find the solution. Below are the formulas:…
-
4
votes3
answers790
viewsIncrease Precision with Bigdecimal Java
Entrances R = new BigDecimal(2.79E+00); Dxm3d = new BigDecimal(3.99E-04); Wmd = new BigDecimal(2.39E-03); x = new BigDecimal(3.2); t = new BigDecimal(365); Below is the formula BigDecimal…
-
4
votes2
answers980
viewsAnalyze sound waves from an MP3 file and representation
Is there any way, in Java/Android, to open an MP3 or WAV file and from the same get the sound waves constantly ? according to its reproduction ? and power from that constant return make its graphic…
-
4
votes1
answer455
viewsCalculation of the weighted moving average with exponential adjustment
How could I calculate the a in the following java formula: I did the following : Df = Df + a(1 -a) xx i I generalized the formula I just don’t know how to calculate the a, like making a formula…
-
4
votes1
answer560
viewsC++ - Sort particular points of a rectangle in a vector?
I have a project in c++ where I should map regions of an image using the mouse click. The point is that I should get the mapping points in a specific storage order, as in the image below: my problem…
-
4
votes1
answer1695
viewsCalculating T-Student Probabilities in R
I have the mean and standard deviation of my distribution: mean = -0.49 ; sd=3.029041 How do I calculate the probability of y a standard deviation below the average using the T-Student with 85…
-
4
votes1
answer14432
viewsCalculation of Sine with Python
Hello, I have a problem in the sine calculus using Pyhton, I set up a function for the sine and cosene calculus, but the result is coming wrong for sine, while the cosene the result is right. I…
-
4
votes1
answer394
viewsBase conversion between Numbering Systems
I am studying Computational Mathematics, more specifically Numbering Systems and their conversion. Numbering Systems are widely used in programming and computing in general, so my study focused more…
-
4
votes2
answers282
viewsAlmost prime numbers
I have a doubt in C, I know check if a number is prime, however, almost cousin do not know.. as I do? Follow the part of the code working! However, just checking if it is prime.. the almost prime…
-
4
votes2
answers6881
viewsHow to find splitters of a number quickly
I have to ask a question that calculates the very large number dividers and needs in a fast way without being the conventional way, could help me My code #include<stdio.h> int main() { int…
-
4
votes1
answer533
viewsGet the frequency from a vector in the frequency domain
I was looking at the following topics: https://stackoverflow.com/questions/7674877/how-to-get-frequency-from-fft-result…
-
4
votes3
answers16658
viewsHow to round up with Python?
Is there a native Python way to top up? Example: 10/3 resulting 4. What I’m wearing now is a parole: x=10 if x % 3 != 0: x += 1 But that’s not very practical.…
-
4
votes1
answer110
viewsHow do computers store and interpret floating point numbers in binary?
In my course of systems analysis and development I started the matter of computational mathematics the subject was numerical bases and conversions, something that caught my attention is that they…
-
4
votes2
answers884
viewsProblem with currency percentage and rounding
How to maintain monetary values with only 2 decimal places when performing percentage operations? Example: Total value: R$ 377,17 Percentage divisions: 33%, 33% and 34% Problem: the sum of the value…
-
4
votes1
answer77
viewsWhy does the Math.toRadians method return an inaccurate value?
I was programming a method in which I needed to convert a value from degrees to radians and I wondered if this conversion no longer existed in Java. Searching the Internet I discovered the method…
-
4
votes1
answer304
viewsBinary sum result
A program capable of operating two binary numbers between 0-255. Program input needs to be in binary and output as well. I did it in a way that was working, so that if I pass in binary 1 + 11, the…
-
3
votes2
answers107
viewsSimple calculation between string and integer
How to stop it from happening? asd = "10" novo=asd/2; console.log(novo) // e ele me retorna 5 Whereas asd is a string and cannot be debt and treated as whole.…
-
3
votes1
answer276
viewsAdd and Remove percentage proportionally
Doubt is in mathematics, a calculation that will be used in a program. Let’s assume I have 3 items with different percentages: Item 1 - 10% Item 2 - 40% Item 3 - 50% I want to remove for example 10%…
-
3
votes4
answers9378
viewsAlgorithm Factorization in C
I need to create a program in C, which factors in any number the user enters. I wrote this code, but it doesn’t work completely because it only calculates once. I don’t want an answer ready, I want…
-
3
votes3
answers331
viewsFind which items have been marked - Help with logic
I have 4 Checkbox, which when selected will assign their values in a variable. The result will be saved in only one field in the BD. When loading these Checkbox, I need to make an account to know…
-
3
votes1
answer112
viewsMove the div according to the value of degrees in Javascript
Simply move the div towards the degress value. I’ve done a lot of manners, but I can’t. A code I’m trying: http://codepen.io/duduindo/pen/eNEobG "Does anyone have any light/solution for this…
-
3
votes1
answer119
viewsI’m in doubt how to do
How to module into some mathematical function in C? I tried some basic things but it didn’t work.
-
3
votes6
answers14587
viewsShow the largest and smallest number
Why are you wrong? var n1 = parseFloat(prompt("Digite um número:")); var n2 = parseFloat(prompt("Digite um número:")); var n3 = parseFloat(prompt("Digite um número:")); function maiorDosTres(n1, n2,…
-
3
votes2
answers1190
viewsHow to perform an algebraic expression on a string in C
My program has the following objective:: Given a function, my program replaces the function'X(s)' by any number. The code below exemplifies what was said. //funcao a ser trabalhada char funcao[150]…
-
3
votes1
answer115
viewsVector calculus C++
I need to implement some vector and matrix operations, such as internal product, vector, other operations with matrices (inverse, transposed, conjugated, determinant, etc.) and to solve certain…
-
3
votes1
answer420
viewsHow to make a transition button similar to Google Translator for a mathematical operation
I’m creating a little calculator that converts Kilograms in Pounds and Pounds in Kilograms. My goal is to insert a value in a first input and display the result in a second input which comes next.…
-
3
votes1
answer115
viewsProblem with calculation result greater than Int64
I am doing the exponent of a number and I need the result to come out in a specific format, however I do not know how to do, follow the code: double num1 = 290287121823; double num2 = 538783; double…
-
3
votes3
answers4632
viewsWhat is the difference between one-dimensional and two-dimensional matrix?
In high school we usually study about the concept of Matrix, which consists of a row table and columns forming a set of numbers or elements. In mathematics, programming and other areas we use…
-
3
votes1
answer120
viewsWhy is an expression with rest and multiplication giving the wrong result?
Why is this code giving as a result -2 and not 7? #include <stdio.h> main() { printf("%i\n", 105 % 3*4 - 3*4 % (101 / 10)); system("pause"); }
-
3
votes6
answers22035
viewsCompute the rest of a decimal division in Javascript
I’m working with values (decimal(18,2)) a sale where the sum of the price of the products is to be converted into a number of parcels. So that I can divide the total of the products exactly for the…
javascript mathematics decimal monetary-value divisionasked 8 years, 11 months ago LeandroLuk 4,989 -
3
votes1
answer972
viewsHow do they represent complex numbers in C?
How to represent a complex number z = x + yi?
-
3
votes1
answer1975
viewsCalculate square root in C#
I have a calculator made in WPF C# with basic operations +,-,*,/, % . And now I wanted to try to improve my calculator. namespace calculadora { public delegate float? dlgoperacao(float? a, float?…
-
3
votes3
answers199
viewsA mathematical method for knowing how many carrys in a sum
I saw today on URI (website programming problems) a question in which your program should read two values and say how many carrys (or "will one"s) happen in the sum of them. Ex: 555 + 555 = 3 carrys…
-
3
votes2
answers635
viewsWhy is this code not calculating the average correctly?
I probably have to be really bad at math today to not be able to make a simple code that calculates the average of two values... I just don’t understand what I did wrong... BTW, I hope the average…
-
3
votes2
answers671
viewsErrors in the program to sort a triangle
I’m in some trouble and I don’t know how to fix it: 1) An equilateral triangle, three equal sides and angles = 60°, is read as an isosceles triangle (two equal sides). 2) In addition to printing…
-
3
votes1
answer190
viewsDivision always resulting in zero
The Alpha result is only returning 0. Why? package javaapplication4; public class MediaMovelSuavizaçãoExp { public double CalculoPrevisao(double[] valores){ double[] values = new…
-
3
votes2
answers196
viewsJavascript - Mathematical module of a value
Is there a command (or symbol) that makes the mathematical module a value? For example: var teste = |10|-|6|;
-
3
votes1
answer1365
viewsBig O notation - Complexity O(log n)
I have some questions about this complexity, which base is used in this logarithm, 2 or 10? and why? Searching Google I saw some comments saying that the base didn’t matter.. The logarithm is deeply…
-
3
votes1
answer474
viewsProbabilistic Considerations on the Calculation of Shannon Entropy in a Network Traffic
Probabilistic Considerations on the Calculation of Shannon Entropy in a Network Traffic I have a dump file (CAP format) of a network traffic capture made with Debian tcpdump. Until a certain time,…
-
3
votes1
answer301
viewsException divided by zero in Java
Why this generates an Arithmeticexception / by zero: for (int i = 1; i <= 5; i++) { System.out.println(i); int a = i / 0; System.out.println(a); } And that’s not (print "Infinity")? for (int i =…
-
3
votes1
answer912
viewsAutocorrelation function in Python
Hello, everybody! I have a file . txt of data with two columns (in X I have the values in days of observations and in Y the Measured Flow of a sample) I intend to calculate the Period with which…