[goffice] Introduce go_complex_invalid_p
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] Introduce go_complex_invalid_p
- Date: Mon, 23 May 2011 23:56:00 +0000 (UTC)
commit 6bd751eca1384f99bf025453ea278e6f6cd84c4f
Author: Morten Welinder <terra gnome org>
Date: Mon May 23 19:55:36 2011 -0400
Introduce go_complex_invalid_p
goffice/math/go-complex.c | 9 ++++++++-
goffice/math/go-complex.h | 2 ++
2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/goffice/math/go-complex.c b/goffice/math/go-complex.c
index 52e10bf..b374d88 100644
--- a/goffice/math/go-complex.c
+++ b/goffice/math/go-complex.c
@@ -311,7 +311,14 @@ int SUFFIX(go_complex_zero_p) (SUFFIX(go_complex) const *src)
/* ------------------------------------------------------------------------- */
-DOUBLE SUFFIX(go_complex_mod) (SUFFIX(go_complex) const *src)
+int SUFFIX(go_complex_invalid_p) (SUFFIX(go_complex) const *src)
+{
+ return !(SUFFIX(go_finite) (src->re) && SUFFIX(go_finite) (src->im));
+}
+
+/* ------------------------------------------------------------------------- */
+
+DOUBLE SUFFIX(go_complex_mod) (SUFFIX(go_complex) const *src)
{
return SUFFIX(hypot) (src->re, src->im);
}
diff --git a/goffice/math/go-complex.h b/goffice/math/go-complex.h
index 2409913..cf0813e 100644
--- a/goffice/math/go-complex.h
+++ b/goffice/math/go-complex.h
@@ -35,6 +35,7 @@ void go_complex_invalid (go_complex *dst);
void go_complex_real (go_complex *dst, double re);
int go_complex_real_p (go_complex const *src);
int go_complex_zero_p (go_complex const *src);
+int go_complex_invalid_p (go_complex const *src);
double go_complex_mod (go_complex const *src);
double go_complex_angle (go_complex const *src);
double go_complex_angle_pi (go_complex const *src);
@@ -69,6 +70,7 @@ void go_complex_invalidl (go_complexl *dst);
void go_complex_reall (go_complexl *dst, long double re);
int go_complex_real_pl (go_complexl const *src);
int go_complex_zero_pl (go_complexl const *src);
+int go_complex_invalid_pl (go_complexl const *src);
long double go_complex_modl (go_complexl const *src);
long double go_complex_anglel (go_complexl const *src);
long double go_complex_angle_pil (go_complexl const *src);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]