I'm just doing some University related Diffie Hellmann exercises and tried to use ruby for it.
Sadly, ruby doesn't seem to be able to deal with large exponents:
warning: in a**b, b may be too big
NaN
[...]
Is there any way arround it? (e.g. a special math class or something along that line?)
p.s. here is the code in question...
Is there some mathematical relation or formula that can estimate a better source code from a less better one?
If I write a program to do exactly the same task using PHP and PERL programming language, for example generating HTML with the text "Hello World!", can these two source code files be evaluated to conclude one is better than the ...
As an extension question my lecturer for my maths in computer science module asked us to find examples of when a surjective function is vital to the operation of a system, he said he can't think of any!
I've been doing some googling and have only found a single outdated paper about non surjective rounding functions creating some flaws i...
Hi all
I am trying to make a 'brush' tool in AS3 (pure, not Flex) which simulates handwriting, making strokes to be smooth instead of cornered. Then, the trace must be reduced to cubic bezier curves which can be dragged and deformed, affecting the previously drawn path (like the illustrator's pen tool).
I'm tracking the mouse movement ...
Hi,
I'm trying to understand some flash animation, and am having difficulty working out the following. Can anyone help?
I want to convert a degree range of 0 to 90, to a value between 0 and 1
These is an existing function to convert from the range 0 to 1 to degrees, eg:
function convertToDegrees(Int:Pos)
{
var rot = (45 * pos);...
Suppose you have several functions y1 = f1(x), y2 = f2(x), etc. and you want to plot their graphs together on one plot.
Imagine now that for some reason it is easier to obtain the set of x for a given y; as in, there exists an oracle which given a y, will return all the x1, x2, etc. in increasing order for which y = f1(x1), y = f2(x2), e...
Hi,
My problem:
How can I take two 3D points and lock them to a single axis? For instance, so that both their z-axes are 0.
What I'm trying to do:
I have a set of 3D coordinates in a scene, representing a a box with a pyramid on it. I also have a camera, represented by another 3D coordinate. I subtract the camera coordinate from the ...
Have searched for this, no luck.
Can someone tell me how create a Ceiling Function in MS access that behaves the same as the one in excel?
...
Is there a direct way of getting the Nth combination of an ordered set of all combinations of nCr?
Example: I have four elements: [6, 4, 2, 1]. All the possible combinations by taking three at a time would be:
[[6, 4, 2], [6, 4, 1], [6, 2, 1], [4, 2, 1]].
Is there an algorithm that would give me e.g. the 3rd answer, [6, 2, 1], in the o...
I am using a 3D engine called Electro which is programmed using Lua. It's not a very good 3D engine, but I don't have any choice in the matter.
Anyway, I'm trying to take a flat quadrilateral and transform it to be in a specific location and orientation. I know exactly where it is supposed to go (i.e. I know the exact vertices where the...
Hi, i have mathematical problem which I'm unable to convert to PHP or explain differently. Can somebody send my in the right direction?
I have two number which are in order (sequence). #1 and #2. I want to somehow compare those two numbers and get a positive number lower than 100 as the result of the comparison. The higher the values, ...
Hey there
For sure this is very trivial math stuff for some of you.
But: When I rotate a view, lets say starting at 0 degrees and rotating forward 0.1, 1, 10, 100, 150, 160, 170, 179, 179,999, and keeping on rotating in the same direction, this happens, to say it loud and clear: BANG !!!! BAAAAAAAAANNNNNGGGG!!!! -179,9999, -170, -150,...
Example: I have a circle which is split up into two halfs. One half goes from 0 to -179,99999999999 while the other goes from 0 to 179,99999999999. Typical example: transform.rotation.z of an CALayer. Instead of reaching from 0 to 360 it is slip up like that.
So when I want to develop a gauge for example (in theory), I want to read val...
I'm writing program in Python and I need to find the derivative of a function (a function expressed as string).
For example: x^2+3*x
Its derivative is: 2*x+3
Are there any scripts available, or is there something helpful you can tell me?
...
Using PostgreSQL, supposing a table like the following:
12184 | 4 | 83
12183 | 3 | 171
12176 | 6 | 95
How can I compute a math expression for each row in the table?
For example, to divide column 2 by column 3, such that the output would be:
12184 | 0.04819277...
Hi all.
I've been doing some research for a mathematical Android related project I'd like to embark upon and I stumbled across for the first time MathML.
Does anyone know of any Java libraries which can do any (preferably all) of the following things?
Parse MathML
Output MathML by parsing standard mathematical notation
Render MathML...
I'd like to write a program that lets users draw points, lines, and circles as though with a straightedge and compass. Then I want to be able to answer the question, "are these three points collinear?" To answer correctly, I need to avoid rounding error when calculating the points.
Is this possible? How can I represent the points in mem...
int x = 73;
int y = 100;
double pct = x/y;
Why do I see 0 instead of .73?
...
HI All,
How can I calculate direction vector of a line segment, defined by start point (x1, y1) and end point (x2, y2)?
Cheers.
...
While displaying the download status in a window, I have information like:
1) Total file size (f)
2) Downloaded file size (f')
3) Current download speed (s)
A naive time-remaining calculation would be (f-f')/(s), but this value is way-to-shaky (6m remaining / 2h remaining / 5m remaining! deja vu?! :)
Would there be a calculation whi...