~ubuntu-branches/ubuntu/feisty/gnumeric/feisty-updates

« back to all changes in this revision

Viewing changes to src/complex.c

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2006-11-14 14:02:03 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20061114140203-iv3j2aii3vch6isl
Tags: 1.7.2-1ubuntu1
* Merge with debian experimental:
  - debian/control, debian/*-gtk-*, debian/rules,
    debian/shlibs.local: Xubuntu changes for
    gtk/gnome multibuild.
  - run intltool-update in po*
  - Build Depend on intltool

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
/* ------------------------------------------------------------------------- */
19
19
 
20
20
char *
21
 
complex_to_string (const complex_t *src, const char *reformat,
22
 
                   const char *imformat, char imunit)
 
21
complex_to_string (complex_t const *src, char const *reformat,
 
22
                   char const *imformat, char imunit)
23
23
{
24
24
        char *re_buffer = NULL;
25
25
        char *im_buffer = NULL;
26
 
        const char *sign = "";
27
 
        const char *suffix = "";
 
26
        char const *sign = "";
 
27
        char const *suffix = "";
28
28
        char *res;
29
29
        char suffix_buffer[2];
30
30
 
65
65
/* ------------------------------------------------------------------------- */
66
66
 
67
67
static int
68
 
is_unit_imaginary (const char *src, gnm_float *im, char *imunit)
 
68
is_unit_imaginary (char const *src, gnm_float *im, char *imunit)
69
69
{
70
70
        if (*src == '-') {
71
71
                *im = -1.0;
83
83
}
84
84
 
85
85
int
86
 
complex_from_string (complex_t *dst, const char *src, char *imunit)
 
86
complex_from_string (complex_t *dst, char const *src, char *imunit)
87
87
{
88
88
        gnm_float x, y;
89
89
        char *end;
138
138
/* ------------------------------------------------------------------------- */
139
139
 
140
140
void
141
 
complex_to_polar (gnm_float *mod, gnm_float *angle, const complex_t *src)
 
141
complex_to_polar (gnm_float *mod, gnm_float *angle, complex_t const *src)
142
142
{
143
143
        *mod = complex_mod (src);
144
144
        *angle = complex_angle (src);
155
155
/* ------------------------------------------------------------------------- */
156
156
 
157
157
void
158
 
complex_mul (complex_t *dst, const complex_t *a, const complex_t *b)
 
158
complex_mul (complex_t *dst, complex_t const *a, complex_t const *b)
159
159
{
160
160
        complex_init (dst,
161
161
                      a->re * b->re - a->im * b->im,
165
165
/* ------------------------------------------------------------------------- */
166
166
 
167
167
void
168
 
complex_div (complex_t *dst, const complex_t *a, const complex_t *b)
 
168
complex_div (complex_t *dst, complex_t const *a, complex_t const *b)
169
169
{
170
170
        gnm_float bmod = complex_mod (b);
171
171
 
189
189
/* ------------------------------------------------------------------------- */
190
190
 
191
191
void
192
 
complex_sqrt (complex_t *dst, const complex_t *src)
 
192
complex_sqrt (complex_t *dst, complex_t const *src)
193
193
{
194
194
        if (complex_real_p (src)) {
195
195
                if (src->re >= 0)
205
205
/* ------------------------------------------------------------------------- */
206
206
 
207
207
void
208
 
complex_pow (complex_t *dst, const complex_t *a, const complex_t *b)
 
208
complex_pow (complex_t *dst, complex_t const *a, complex_t const *b)
209
209
{
210
210
        complex_t lna, b_lna;
211
211