Top "Math" questions

Math involves the manipulation of numbers within a program.

Divide a number by 3 without using *, /, +, -, % operators

How would you divide a number by 3 without using *, /, +, -, %, operators? The number may be signed or unsigned.

c math division divide
Round a divided number in Bash

How would I round the result from two divided numbers, e.g. 3/2 As when I do testOne=$((3/2)) $testOne contains "1" when …

linux bash math shell rounding
What is the maximum number of edges in a directed graph with n nodes?

What is the maximum number of edges in a directed graph with n nodes? Is there any upper bound?

algorithm math graph max
How to round up integer division and have int result in Java?

I just wrote a tiny method to count the number of pages for cell phone SMS. I didn't have the …

java math types formatting
Undefined reference to `sin`

I have the following code (stripped down to the bare basics for this question): #include<stdio.h> #include&…

c math linker-errors undefined-reference
Creating all possible k combinations of n items in C++

There are n people numbered from 1 to n. I have to write a code which produces and print all different …

c++ algorithm math combinations combinatorics
How should I throw a divide by zero exception in Java without actually dividing by zero?

I have an I2C device that wants two inputs: a denominator and a numerator. Both are written to separate …

java exception math divide-by-zero
How to determine if a list of polygon points are in clockwise order?

Having a list of points, how do I find if they are in clockwise order? For example: point[0] = (5,0) point[1] = (6,4) point[2] = (4,5) …

math geometry polygon computational-geometry
How to tell whether a point is to the right or left side of a line

I have a set of points. I want to separate them into 2 distinct sets. To do this, I choose two …

c# math geometry convex-hull
less than 10 add 0 to number

How can I modify this code to add a 0 before any digits lower than 10 $('#detect').html( toGeo(apX, screenX) + …

javascript jquery math