|
Don't advertise.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi there,
in my app i have to calculate a value using this syntax:
x = 2^(y / 2)
but ^ ist a logical operator in c#. what could be meant? how would i calculate x if, for example y = 4,33984375? or does ^ have a different meaning in this context (for example Math.Pow?).
does anyone possibly understand what i'm after? any help is greatly appreciated.
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
matthias s. wrote: x = 2^(y / 2)
To what context your expression belong?
I mean, if it is a Visual Basic (VB6) one, then it translates to the following C# equivalent:
x = Math.Pow(2, y / 2);
On the other hand, if the context is C#, it simply doesn't make sense.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
Even I am not sure, what you want to achieve with that operator, but "^" is a logical exclusive - OR for binary type. Meaning the result will be true only if only one of the operand is true.
"^" for the integral types (as above in your case) computes bitwise exclusive-OR of its operand. hence it will compare the each bit and apply exclusive-OR on each bits to find the last result.
Manoj
Never Gives up
|
|
|
|
|
Manoj Kumar Rai wrote: but "^" is a logical exclusive - OR for binary type.
Actually for single bits.
Manoj Kumar Rai wrote: "^" for the integral types (as above in your case) computes bitwise exclusive-OR of its operand. hence it will compare the each bit and apply exclusive-OR on each bits to find the last result.
He asked about doubles!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I expect that Math.Pow is what you want, but in some organizations you can get in trouble for thinking, so use the statement as told and shrug your shoulders when someone reports a bug.
|
|
|
|
|
Hi Matthias,
Try **. Just kidding
Jeff
|
|
|
|
|
Hey folks,
I've got a simple question:
What's your favorite Math-Library (besides Math.h
I need a really good math-library which has FFT and SVD and a bunge of other stuff...
*I tried JAMA, which is not too bad, but has too few functions for me
*Matpack (surely a great Library but I only get errors when trying to compile)
(www.matpack.de - maybe someone can help me get this running)
*I even tried copying (well, more like typing from) "Numerical recipes in C" and even those ended in an endless loop when trying to do an svd.
any suggestions?
|
|
|
|
|
|
I don't know what your detailed requirements are, there is no gold standard of which I am aware. Recently I have been using Intel MKL - this has impressive FFT performance, haven't used SVD yet. For freeware FFT, FFTW is probably the best. I have used IMSL but it is expensive, and I have a query in my mind over licensing for use in products. For free linear algebra you could consider getting a fortran compiler and compiling the NETLIB routines you want into a library.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
how about Blitz its gives you matlab like capabilities for C++
here is the link: http://www.oonumerics.org/blitz/
|
|
|
|
|
I'm on the same hunt for other reasons. Blitz looks good but even it seems to rely on the IEEE 754:1985 approx implementation built into the C Runtime . Do you know of any indepenent IEEE/libm implementation in C++?
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi Queezy,
I can't speak for FFTs and SVD (what are you doing with decomposition, BTW? I recently read a paper which used SVDs as a text indexing algorithm such as Google), but I personally love Crypto++ for anything Cryptography related. This includes its Large Integer package, and Elliptical Curve implementation.
Jeff
|
|
|
|
|
Does anyone know of any good algorithms for calculating a total shipment cube size based on the sizes and quantities of the products in that shipment?
|
|
|
|
|
You may have to look at figuring the volume of each individual product, how many to ship at a time, and then figure out the cube size based on the total volume of the products being shipped...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi All,
I need to find the value after decimal in mathematical way...
Ex: I have a number 19.56 and my formula gives me .56
Please help me...
Thanks in advance...
|
|
|
|
|
What language are you programming in?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Thanks for the help.I need a mathematical way I dont want to use programming language for this....
|
|
|
|
|
By convention there is the [] operator, defined the following way
[x] = the integer part of x
hence you can use
x-[x]
to extract the decimal part of x
But, I know, it's just another way to say: 'take the decimal part of x ' (BTW it is also a perfectly accetable function definition).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
ExpertComing wrote: The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
LOL...
|
|
|
|
|
in mathematical way I would say
.56 = 19.56 - floor(19.56)
or in c++
float rest = 19.56 - int(19.56);
sufficient?
|
|
|
|
|
|
|
I think it is important for you to clarify what to do with negative numbers. What would you want to obtain with -19.56? -.56 or .44 (=-19.56-20.00)? The formula is usually simple for positive numbers because we all agree the integer part is the largest integer not greater than the given number, but for negative numbers we have to decide which reference to have (either 0 or -oo).
Rilhas
|
|
|
|
|