Click here to Skip to main content
15,891,757 members
Everything / Mathematics

Mathematics

mathematics

Great Reads

by William Hey
Classical number theories
by jurhas
A small simulator for a 6 axis articulated robot
by Ryan Scott White
A C# struct/class library for large Floating-Point numbers
by Gunnar S
Implementation of the Poisson Cumulative Distribution function for large Lambdas

Latest Articles

by Ryan Scott White
A C# struct/class library for large Floating-Point numbers
by Kenneth Haugland
Radiation from rectangular, circle and elliptic - shaped openings
by JorgeLuisOrejel
This article describes the implementation of Dijkstra's Smoothsort as a generic sorting algorithm in C#.
by Xavier Junqué i de Fortuny
Reduces/evaluates a real/complex math expression

All Articles

Sort by Title

Mathematics 

12 Apr 2022 by Will Sewell
I have some code in a SQL stored procedure which changes negative values in a column to zero -Sum(Bonus) As Bonus, Case WHEN -Sum(Bonus)
14 Apr 2022 by Maciej Los
Try this: SELECT SUM(COALESCE(BSE.MinWageEarning, BSE.TotalBeforeMinWage)) - SUM(BSE.TotalBeforeMinWage) AS Bonus FROM vBookingSessionEmployees AS BSE ... For further details, please see: COALESCE (Transact-SQL) - SQL Server | Microsoft...
10 Sep 2012 by WebMaster
As you know computer doesn't show all of digits of a large number.For example it show "1.07150860718627E+301" as result of:Math.Pow(2, 1000);How can I have got normal mode result?
10 Sep 2012 by Matt T Heffron
The problem is that is being computed in type double, which is only 64-bits. double is a "floating-point" representation and stores numbers as the most significant 53 bits of the number and a 10 bit "scale". This is why only about 15 decimal digits of prcision are possible.If you really need...
11 Sep 2012 by Sergey Alexandrovich Kryukov
The root problem is that the floating-point types are designed for approximate calculations. This is unavoidable in principle. Did you know that in general case, the single real number contains the infinite volume of information? So, there is no a way in principle to present such value without...
3 Jun 2013 by IND-CODENAME-47
HI All,I have a requirement on urgent basis. I need to cut a 3D cube along x and y directions.Suppose that i have a cube of certain dimension and have 3 text boxes representing X,Y and Z direction. Now When i put any values in X and Y according to that the main 3D cube gets bisect.For...
27 Jun 2014 by Member 10911218
If only draw cube,it's easy,you can use OpenGl.If draw cube and flat text. you can use OpenGl and freetype to do it.If you don't know about the OpenGl or DirectX 3D ,then you can use the 3D controls, such as: EWDraw 3D ActiveX
8 Jul 2010 by Joan M
Hello all,My math skills are not the best in the world... :~The problem here is that I have a robot and I need to calculate different points mathematically.The main idea here is that I have two points in the space with different orientations:XYZ is the position in the...
18 Mar 2010 by Nelek
The ABC angles have to be considered as (note the capital letters):XYZ = base coordinatesxyz = tool coordinatesIf you get Z and twist the XY-Plane, you get X'Y' where A is the angle between X and X'If you now get the new Y' and twist the X'Z plane, you will get X''z-Plane where B is...
8 Jul 2010 by Joan M
Solved: First I have needed to go from EULER to QUATERNIONS and then calculate the interpolations. After that I've passed the results (in quaternions) back to EULER angles.
27 Feb 2024 by Ryan Scott White
A C# struct/class library for large Floating-Point numbers
11 Dec 2023 by JorgeLuisOrejel
This article describes the implementation of Dijkstra's Smoothsort as a generic sorting algorithm in C#.
10 Jun 2015 by Member 11758214
Hi guys, I have a string such as "x = 1, y = 2", and then I want to calculate the result of string "x + y" or "x * y", does any library can implement what I want??? Thanks very much!
10 Jun 2015 by Andy Lanng
Nope. You may find an API but I'd write one myself.Look at the below example of how to parse arithmetic strings using stacked operators There may be a API you can pull out of it:Math Parser .NET C#[^]
11 Jun 2015 by Stefan_Lang
This has nothing to do with math. Consequently you don't need a math library, but an expression parser: https://www.google.ch/search?q=experession+parser&ie=utf-8&oe=utf-8&gws_rd=cr&ei=D4J5VZmaHoKQsAGDh6eYBw#q=expression+parser+C%2B%2B[^]The first hit on that search already looks promising....
17 Jun 2019 by Member 14501479
Hello everyone, I'm just starting coding yesterday, so I am so new at this, in my mind I have an idea but I do not how to code.I've got Microsoft Visuals(c++), btw. So I'm trying to code something very easy.-- Number 1= x Number 2= y Number 3= z Number 4= q So how can i programme something...
15 Jun 2019 by OriginalGriff
Assuming you have read in the numbers: double result = (x + y + z) / q; cout
17 Jun 2019 by KarstenK
The above solutions is correct but to handle it you need to visit and understand some basic tutorial for Learning C++.
17 Jun 2019 by Patrice T
Quote: I'm just starting coding yesterday, so I am so new at this Advice: Don't start learning by doing personal project, it is a bad idea, you are wasting your time. Start learning by following some tutorials completely, then start with simple personal project. Quote: If theres a tutorial, im...
1 Apr 2013 by subskybox
Exploiting JavaScript's weakly typed implicit data type conversions, the 52 bit mantissa and common bit hacks.
30 Sep 2013 by Kenneth Haugland
Ok, this is going to take some explaining before I present the code. The algorithm Im implementing is called TLM [^]for short. To construct the algorithm I have noticed that each cell or node, can communicate with 4 of its neighbors, called North, South, West and East for conviniance. In...
30 Sep 2013 by Kenneth Haugland
Ok. I found out what was wrong, its the sequence of events.First calculate all scatter, for all points, then propagate the sound pressure. Or in code:Private Sub SimulationTimer_Tick(ByVal sender As Object, ByVal e As EventArgs) ' Updating the Label which displays the current second...
3 Apr 2019 by Mahsa Hassankashi
This article also has a practical example for the neural network. You read here what exactly happens in the human brain, while you review the artificial neuron network.
16 May 2012 by Member 8915689
Hi,I'm having trouble to understand what's going on with my FFT. Given a number of sinusoidal points, I need to fit them into a sine function. That is, I need to know A, B, C and D from y = A·sin(B·t+C)+D.The way I intended to do it was by performing the FFT -> D (the offset) would be...
17 May 2012 by Member 8915689
I see the problem now, I was watching it from the wrong way... The FFT of a sine with a non complete number of cycles is the sum of lots of sines with different phases and amplitudes, that's why the complex plot is shown that way...So, the question is: can I make any kind of calculation with...
10 Dec 2013 by Petr Ivankov
Multidisciplinary paradigm of software development
18 Jan 2014 by Petr Ivankov
Application of abstract approach to database domain
14 Jan 2024 by Kenneth Haugland
Radiation from rectangular, circle and elliptic - shaped openings
22 Dec 2017 by Patrice T
This is a challenge assigned by you to you: SPOJ.com - Problem ADACAROT[^] The idea is that you solve it yourself. We are not here to solve the problem for you and then explain it to you in detail, that would defeat the propose of the challenge.
7 Feb 2014 by The Kcrownikown
Is it possible to add numbers without using the '+' operator?WITHOUT SUBTRACTION
6 Feb 2014 by CPallini
Yes, of course int a = 5; int b = 10; int c = a - (-b);
7 Feb 2014 by Karthik_Mahalingam
using System;using System.Collections.Generic;using System.Linq;class Program{ public static void Main(string[] args) { int a = 34; int b = 55; int[] array = {a,b }; int sum = array.Sum(); //89 }}
8 Feb 2014 by CPallini
The "Bitwise operations in C" Wikipedia's page, provides an example[^].
8 Feb 2014 by Abhinav S
Its possible with bitwise operations.You can find some implementations if you search on the internet.
22 Feb 2019 by Member 14099637
je veux calculer le nombre d’étiquette dans un rouleau selon les paramètres suivants: 1.largeur de l’étiquette 2.longueur de l’étiquette 3.Diamètre total de la bobine 4.Diamètre du mandrin 5.Ecart entre 2 étiquettes [edit] I want to calculate the number of labels in a roll according to the...
22 Feb 2019 by Richard MacCutchan
OK, that is mathematics not programming.
22 Feb 2019 by CHill60
Try posting your question on this forum instead - Algorithms Discussion Boards[^] - Essayez de poster ceci sur cet autre forum You should also consider the thickness of the label and it's carrier paper Vous devriez également considerer l'épaisseur de l'étiquette et du papier support Bon chance
22 Feb 2019 by Patrice T
Hi, first of all, this forum is using English language. Quote: je veux calculer le nombre d’étiquette dans un rouleau. je ne connais pas la formule pour faire le calcul.Merci Easy, Those parameters do not allow to compute the number of stickers. Bonjour, tout d'abord, ce forum est en...
26 Oct 2018 by José Cintra
Simple algorithm to determine the type of a triangle, being informed its sides
24 Aug 2014 by José Cintra
Some suggestions of algorithms for computing the Fibonacci numbers addressing iterative, recursive and functional paradigms
18 Aug 2014 by José Cintra
Some suggestions of algorithms for solving the Pascal Triangle, addressing iterative, recursive and functional paradigms
21 Jan 2013 by Simeon Sheye
Beyond basic unit tests, how do you choose your tests and when are you done?
21 Jul 2021 by rtybase
Another number theory problem
9 Jun 2013 by rtybase
Another probability problem
22 Sep 2020 by angusmax
I have a long sequence of calculations (using variables of type "double") where some operations might result (depending on input values) in "NaN" or "Infinity".Since I don't want to add something like the following:if ((double.IsInfinity(result)) || (double.NaN(result))) {...}after...
7 Jun 2013 by Ahmed Bensaid
Hello,I think you'll need to raise the exception yourself like this :if ((double.IsInfinity(result)) || (double.NaN(result))) { throw new ArithmeticException();}
7 Sep 2017 by Javier Luis Lopez
I have the following mathematical problem: If making reduction operations over large arrays creates rounding errors. As example adding more than 100k samples using floats begin to generate errors of 1% I solved partially using a reduction by using a tree adding by pairs (as it is said in this...
7 Sep 2017 by Patrice T
Quote: Avoiding large arrays rounding error There is no large array rounding error, your problem is about floating point limitations. Using a double datatype may solve your problem. Your problem is related to mantissa range, the mantissa is limited. This means that when you add a value large...
30 Aug 2017 by Ravimal Bandara
An implementation of Bag-Of-Feature descriptor based on SIFT features using OpenCV and C++ for content based image retrieval applications.
3 Aug 2010 by Tim-bot
Simple calculation to determin a value at a percentage along a bell curve. Also with an offcenter curve intersection thing....
4 Jul 2021 by KarNullKa
I found a project mono/decimal.c at ee90d5ff1d521f92c3dd9cca79b002dc4bc65ee3 · mono/mono · GitHub[^] where there are methods of mathematical operations with different values. But I need help with a row sub192(rlo, rmi, rhi, 0, tlo, thi, &rlo,...
4 Jul 2021 by OriginalGriff
To answer that, we'd have to do all the donkey work - a good hard look at what is a pretty-much undocumented project that few of us would have much need for. Why would you assume we'd want to do that for no good reason? Ask the original author:...
5 Jul 2021 by KarNullKa
The line I asked about is correct.It doesn't subtract the same parameters like lo, mid, hi because the values need to be shifted to subtract the highest part of the number. Therefore, the method sub192(rlo, rmi, rhi, 0, tlo, thi, &rlo, &rmi,...
19 Oct 2017 by E.Açıkgöz
Write a program that reads there integers from the user(keyboard) namely, n, a and b. Your program sohuld print all positive numbers satisfying the following condition: *The number smaller than n and the ratio of the number and sum of its positive divisors is equal to a/b. You should print the...
19 Oct 2017 by Richard MacCutchan
The following code makes no sense. The first iteration of your loop will terminate your program. for(i = 1; i
19 Oct 2017 by KarstenK
You should write for every needed output a function which deliver it and than do the output. You can define an array like this, but you also need to free the memory: int *arr = 0;// define pointer int count = fillArrayFunc( arr, a, b, n ); for( int i = 0; i
21 Jan 2015 by Member 11393116
Hi tried generating the polynomial equation using excel sheet. It is very accurate and gives me exact polynomial equation. Is there any C# code to generate the polynomial equation for the given datapoints which gives the exact polynomial equation similar to the equation generated in excel....
21 Jan 2015 by Sergey Alexandrovich Kryukov
This is one of the libraries you may want to use: https://numerical.codeplex.com[^].Please see my comment to the question. First of all, you need to decide for yourself, what kind of mathematical problem should be solved.—SA
12 Mar 2020 by Mohammad Elsheimy
My C# implementation of linear algebra concepts (matrix elimination, multiplication, inverses, determinants, etc.)
16 May 2013 by Joezer BH
MS chose to insert a representation of Infinity in Double and Float but not in Decimal and Int64?You have:Double.PositiveInfinity & Float.PositiveInfinity (as well as Double.Epsilon & Float.Epsilon) which are missing in Decimal.Q: Why?Moreover: I understand the concept of decimal...
9 Apr 2013 by Thomas Daniels
Hi,Have a look here:http://stackoverflow.com/questions/986268/why-is-nan-not-a-number-only-available-for-doubles[^]The StackOverflow question is a question about why NaN is only available for doubles, but it also applies to PositiveInfinity.
16 May 2013 by BobJanova
The short answer is 'because that's what the standard says'; IEEE floating point defines infinities and NaNs, whereas the integer standards don't. Decimal, despite having a floating point in the most literal sense of that term, is based on the integer standards (and obviously long is a native...
25 Feb 2016 by Frank R. Haugen
My code:using System;namespace PolarToCart{ class Program { static void Main(string[] args) { double r; double θ; double ϕ; string result = ""; r = 1.0; θ = 2.0; ϕ = 3.0; result = Convert.ToString( r * Math.Sin(θ) *...
25 Feb 2016 by Jochen Arndt
The arguments to the trigonometric functions are in radians. If your input is in degrees, you must divide by 2 * Pi:result = Convert.ToString( r * Math.Sin(θ / (2 * Math.PI)) * Math.Cos(ϕ / (2 * Math.PI)) );[EDIT]Used thew wrong factor.result = Convert.ToString( ...
25 Feb 2016 by OriginalGriff
And I'd agree with it: https://www.wolframalpha.com/input/?i=1.0+*+Sin(2.0)+*+Cos(3.0)[^]Wolfram alpha agrees.As does my calculator (Sharp EL-5020)Are you sure your calculators aren't assuming that θ and ϕ are in degrees, rather than radians, like my calculator, Wolfram Alpha, and .NET?
25 Feb 2016 by Frank R. Haugen
The fixed code:using System;namespace PolarToCart{ class Program { public double ConvertToRadians(double angle) { return (Math.PI / 180) * angle; } static void Main(string[] args) { double r; double θ; double ϕ; string result = ""; r =...
16 Nov 2018 by Member 12349103
I want to get the Max value between 2 columns and return it to a third column, if they are the same return that values. Each line in debug shows a value. except for d3 where the value should be placed after it determines the highest value. Ideas of what I'm doing wrong? Image of Degug Image -...
16 Nov 2018 by OriginalGriff
You don't show us what you do with the eventual value (in AL) but since it's just a variable unless you "add it to a column" it's not going to show. The first thing you need to do is break out the debugger and look closely at exactly what is happening when you run that code with your data: put...
16 Nov 2018 by Patrice T
Quote: I want to get the Max value between 2 columns and return it to a third column, if they are the same return that values. This code calc the max of 3 values and don't try to store the result in another column. Your code do not behave the way you expect, or you don't understand why ! ...
8 Apr 2020 by Gunnar S
Implementation of the Poisson Cumulative Distribution function for large Lambdas
14 Jun 2012 by Hesha
I want to Round up Some values to a With out Decimal places. but i want it as this :Ex if Doubel Val = 3.2 then i need to round up this Value as a 4.0 Not as 3.0. Can anyone have a Solution on this matter. Math.Round(Val, MidpointRounding.AwayFromZero);But it does not bring the Right...
14 Jun 2012 by Roman Lerman
Hi,val = System.Math.Ceiling(val);Have a nice day
30 Jun 2010 by Tom Hangler
Guys. Im a c# noob but I really need a professional's help. I am using visual studio 2005 for a project so I dont have math.linq I need to calculate the standard deviation of a generic list of objects. The list contains just a list of float numbers, nothing too complicated. However I have never...
30 Jun 2010 by William Winner
A simple google search of c# and standard deviation gave this:private double getStandardDeviation(List doubleList){ double average = doubleList.Average(); double sumOfDerivation = 0; foreach (double value in doubleList) { sumOfDerivation += (value) *...
28 Nov 2011 by Grant Curell
A basic copiable count sort implementation.
10 Jun 2010 by gianluca.ferrari
Hi,I'm trying to do an Offset function from a polygon.The main polygon that I have to offset is somethings like this: ______________________ | | | | | ...
10 Jun 2010 by Stephen Hewitt
Perhaps if you explain what you're trying to do...
11 Jun 2010 by Niklas L
To offset the polygon, all you have to to is add the offset, in required dimension, to each vertex/coordinate.
11 Jun 2010 by Henry Minute
Depending on what your Polygon is (Image, Array of Point etc....) you might be able to use a Matrix Translation. If so Matrix Transformation of Images in C#, using .NET GDI+[^] might be of some use.
29 Jul 2015 by User 11633146
How to calculate square root using Newton's iterative method
28 Dec 2012 by User 8984948
The purpose here is not the mathematical stuff, but to provide two implementations of the factorial of a number in Delphi (Object Pascal).
2 Sep 2014 by José Cintra
Iterative algorithms for computing approximations to the number PI through infinite series using double and arbitrary precision
13 May 2020 by Askar Azhibaev
Calculating the pi number faster using a simple formula
30 Jan 2018 by Member 13652674
Can a constant change value? What I have tried: Nothing????????????????????????????????????????????????????????
30 Jan 2018 by ZurdoDev
No, that is why it is called a const.
30 Jan 2018 by Patrice T
Quote: I don't know how to do it. Short answer: you don't. By definition, a constant is constant, its value don't change.
14 Sep 2023 by Vishant Sandilya
Samodelkin, Professor decided make by hand volumetric model bricks from matches, and use the matches for edges. Length of edges of every brick equally for one match. For model’s construction of three bricks, he uses 28 matches. What least...
15 Aug 2023 by Richard MacCutchan
Go back to the question and look at the picture. From that you can see that a brick at the end of a block requires 12 matches, and one inside the block requires 4. So from that you can easily calculate the number of matches required for any...
15 Aug 2023 by OriginalGriff
What it is saying is that a brick is a cube, and has sides one match long. So a single brick requires 12 matches. If you put two bricks together, they can share matches: one needs 12, the other needs 4 less. For three or more bricks, each end...
15 Aug 2023 by merano99
As jeron1 has already commented, according to the sketch, blocks of 12 matchsticks are obviously assembled at the edges. While you need all 12 matchsticks for the first block, you need only 8 for each further block. The result should not exceed...
8 Mar 2020 by Richard MacCutchan
Sorry, this site does not provide free code conversion.
8 Mar 2020 by KarstenK
You should learn Javascript with some tutorial and solve that problem. Pay attention to clear coding and proper inclusion in the HTML. Use some Javascript supoorting editor with highlighting and code checking like Visual Studio Code. It isnt to...
22 Aug 2018 by Member 13958396
This is my first time doing matlab and I've never coded before. This was a compulsory Uni paper that I have had to take. Prior to this task I've managed to complete various other tasks but this is challenging me beyond what I've learned in the last three weeks. This is what ive got down so far...
22 Aug 2018 by Patrice T
So, you show no attempt to solve the problem yourself, you have no question, you just want us to do your HomeWork. HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing. We do not do your HomeWork....
27 Aug 2017 by Skapelse
Hello everyone, i am new here so i am sorry if i am posting this in the wrong category. I'm a begginer programmer and i am trying to get better. Right now i am writing a small tool that solves mathematical problems. I would very much appreciate it if you could tell me what i'm doing wrong and...
27 Aug 2017 by Richard MacCutchan
if (operation.equals("+")) { SimpleCalculator simpleCalc = new SimpleCalculator(); double result = simpleCalc.add(numOne, numTwo); System.out.println("The result is " + result); } else if (operation.equals("-")) { SimpleCalculator simpleCalc = new SimpleCalculator(); double result =...
21 Mar 2018 by CPallini
Yes, direction is affected. You should compute the horizontal and vertical components of the particle speed in the frame where the hit wall is the horizontal axys, invert the vertical speed component and then transform back to original axys.
21 Mar 2018 by Shortground
(a,b)inside the triangle: a>0 b>0 4a+3b
23 Sep 2015 by Member 12008365
Hello.I'm trying to solve problem 6 at the project euler site, but I'm having trouble.This is my code so far:var square = 0;var sum = 0;var result = 0;for (var i = 0; i
23 Sep 2015 by OriginalGriff
Um...Look at your code:for (var i = 0; i