numerical

Need help with C# function to translate smoothly between numeric ranges

I'm trying to write a function : Input: Source range, Source value, output range, curve type (Linear, smooth) Output: The output is the "source value" converted into the "output range" according to the curve type. I hope I am making sense here... Any ideas ? Thanks. ...

Good books on numerical computation with C

Hi, I've read the post "What is the best book on numerical methods?" and I wish to ask more or less the same question but in relation to C programming. Most of the time, C programming books on numerical methods are just another version of the author's previous Fortran book on the same subject. I've seen Applied numerical methods in C by ...

Information on Rojiani's Numerical methods C textbook

Hi, having taken a look at a few textbooks that discuss numerical methods and C programming, I was gladly surprised when browsing through "programming in C with numerical methods for engineers" by Rojiani. I understand of course it's important that one need to have a solid background in numerical methods prior to try implementing them on...

Numerical Pattern Matching

A project I'm researching requires some numerical pattern matching. My searches haven't turned up many relevant hits since most results tend to be around text pattern matching. The idea is we'll have certain wave patterns we'll need to be watching for and trying to match incoming data vs the wave database we will be building. Here is and...

How can I add floats together in different orders, and always get the same total?

Let's say I have three 32-bit floating point values, a, b, and c, such that (a + b) + c != a + (b + c). Is there a summation algorithm, perhaps similar to Kahan summation, that guarantees that these values can be summed in any order and always arrive at the exact same (fairly accurate) total? I'm looking for the general case (i.e. not a ...

PHP: Is_numeric returns false on 0

Hi everyone, Is_numeric() as well as is_int() returns false if the value is 0. What can i do instead to verify that a specific value is numbers only in PHP? Are we heading straight for the Regular Expressions camp, or are there some nice, handy feature for this out there already? Thanks! ...

How do I type a floating point infinity literal in python

How do I type a floating point infinity literal in python? I have heard inf = float('inf') is non portable. Thus, I have had the following recommended: inf = 1e400 Is either of these standard, or portable? What is best practice? ...

python floating number

i am kind of confused why python add some additional decimal number in this case, please help to explain >>> mylist = ["list item 1", 2, 3.14] >>> print mylist ['list item 1', 2, 3.1400000000000001] ...

Scientific Library Options for C or C++

I'm in the process of choosing a scientific library to use as a basis for a project. I need to do a lot of statistical, linear algebra, and signal processing tasks, and I figured there are probably some great libraries that already do this stuff better than I could program it myself. For c++, I know about Boost, but don't have much expe...

Any decent alternatives to Numerical Recipes?

I'd like an up-to-date overview of numerical methods with working code written in any programming language (the higher level the better). Numerical Recipes was good in this sense when it was first published in 1988 but their subsequent editions failed to bring it up to date. For example, the coverage of FFTs in NR's third edition (2007)...

what's the purpose/point of the REAL() Datatype in mysql?

what's the purpose/point of the REAL() Datatype in mysql? You have float,double and decimal which i understand but where does the "real" datatype come into it? Any ideas? Thank you in advance ;-) is real the same as float or double? ...

NIST non-linear fitting benchmark Misra1a

I have been toying with some codes to solve this using a Levenberg-Marquardt solver but I am puzzled by what is given here http://www.itl.nist.gov/div898/strd/nls/data/LINKS/DATA/Misra1a.dat When I plug in the certified values and look at the predicted values, they look quite different from the actual Y values... surely I am doing somet...

How can I numerically solve equations containing Bessel functions in MATLAB?

I have confronted an equation containing Bessel functions of the first type on one side and modified Bessel functions of the second type on the other. I want to know its exact solutions (values of u). The equation is as follows: u*besselj(s-1,u)/besselj(s,u)=-w*besselK(s-1,w)/besselk(s,w) where s is an arbitrary integer number, for ex...

Does JavaScript have double floating point number precision?

I know it's an odd question, but does JavaScript have the capacity to work with double's as opposed to single floats? (64 bit floats vs. 32 bits.) ...

Numerical problems in Matlab: Same input, same code -> different output?

Hi, I am experiencing problems when I compare results from different runs of my Matlab software with the same input. To narrow the problem, I did the following: * save all relevant variables using Matlab's save() method * call a method which calculates something * save all relevant output variables again using save() Without changing ...

Numerical Error in simple CUDA code

I just started experimenting cuda with the following cude #include "macro.hpp" #include <algorithm> #include <iostream> #include <cstdlib> //#define double float //#define double int int RandomNumber(){return static_cast<double>(rand() % 1000);} __global__ void sum3(double const* a, double const* b, double c...

Fastest 128 bit integer library

I am working on a CPU-heavy numerical computation app. Without going into many details, it's a computational math research project that involves computing a certain function f(x) for large integer x. Right now everything is implemented in C++ in x64 mode, using native 64-bit ints. That limits me to x<2^64~1.8*10^19. I want to go furthe...

Is the "e" character used to denote an invalid number in graphics data?

I've got a graphical program that's exporting a data file with numbers such as: -1.33227e-015 and -4.02456e-016. I've long been perplexed by the "e-" notation. Is it used to denote an invalid number? What sort of valid value can I extract from the above numbers? What are they trying to say? ...

What gets converted to what when comparing a double to an integer for identity?

OK, so I know you're generally not supposed to compare two floating-point numbers for equality. However, in William Kahan's How Futile are Mindless Assessments of Roundoff in Floating-Point Computation? he shows the following code (pseudo-code, I believe): Real Function T(Real z) : T := exp(z) ; ... rounded, ...

Check for closed path in numerical heightmap

Hi all, I'm working on a game, and I have the necessity to check a closed path in a given numerical heightmap: The server and the client use this heightmap to set the right coords to move etc... Now, when an user walks on a "special" tile, it lights... My problem is: When an user, walking on these tiles creates a closed path with empty t...