Top "Math" questions

Math involves the manipulation of numbers within a program.

How to map atan2() to degrees 0-360

atan2(y, x) has that discontinuity at 180° where it switches to -180°..0° going clockwise. How do I map the range …

math quartz-2d atan2
How to test if a double is an integer

Is it possible to do this? double variable; variable = 5; /* the below should return true, since 5 is an int. if variable …

java math
C: how to break apart a multi digit number into separate variables?

Say I have a multi-digit integer in C. I want to break it up into single-digit integers. 123 would turn into 1, 2, …

c math numbers digits digit
How to use nan and inf in C?

I have a numerical method that could return nan or inf if there was an error, and for testing purposed …

c math
Exponentiation in Python - should I prefer ** operator instead of math.pow and math.sqrt?

In my field it's very common to square some numbers, operate them together, and take the square root of the …

python math exponentiation
How do I divide so I get a decimal value?

I want to know how to get remainder and quotient in single value in Java. Example: 3/2 I should get value …

java math division modulus
Why is the Fibonacci series used in agile planning poker?

When estimating the relative size of user stories in agile software development the members of the team are supposed to …

math statistics agile agile-project-management
How can I get sin, cos, and tan to use degrees instead of radians?

When I'm working with math in JS I would like its trig functions to use degree values instead of radian …

javascript math
minimum double value in C/C++

Is there a standard and/or portable way to represent the smallest negative value (e.g. to use negative infinity) …

c++ c math
Calculate percentage saved between two numbers?

I have two numbers, the first, is the original price, the second, is the discounted price. I need to work …

math formula