The latest "PhaseWindup.cpp" file(line 105) call the function 'round', but I don't find any declaration in the file or the others.

d = prev - windup;

windup += round(d);

So I want to know are there these basic math functions in gpstk ?

Several months ago, I write a "MathUtils" class base on the gpstk, it wrapper the following functions:

1) fractional part a number

2) Modulo a number

3) round a double to the nearest integer or long

4) legendre polynomial

5) and so on

If this class is usefull, I'd like to upload it to gpstk.

Thank you.

-- YanWei - 03 Sep 2009


ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

The round function is provided by the compiler. See for various rounding functions. Modulo is provided by the % operator built into the language. The function modf returns the factional part of a number. It is my opinion that we shouldn't create routines in the GPSTk that does those as you can get that functionality through the compiler. Now for the legendre polynomial, that might be an option or it might be better to use a 3rd party library that implements those like this Boost library That question should really be posed to the GPSTk development email list for feedback and discussion at

-- RickMach - 03 Sep 2009

Hi, RickMach

You are right, we should use functions provided by the compiler as far as possible. But there are no "round" and "modf" for some compiler, and % can only work with integer. GPSTk is designed to be as platform-independent as possible, that request developers should use ANSI standard functions rather than GNU functions to make the codes more portable.

It's only my opinion, just a suggestion.

Thank you very much.

-- YanWei - 03 Sep 2009

That is true. I would suggest you email the code with your suggestion to the gpstk developer list and get a discussion going there. This is where these type of discussions typically happen.

-- RickMach - 06 Sep 2009

Hi, Agagin

I'm sorry for presenting this question in a wrong place, and I'll send email to the gpstk developer list next time.

Sorry again!

-- YanWei - 07 Sep 2009 No such template def TMPL:DEF{PROMPT:supportquery}

Topic revision: r5 - 07 Sep 2009, YanWei

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback