diff src/xpow.cc @ 2800:9aeba8e006a4

[project @ 1997-03-09 09:50:20 by jwe]
author jwe
date Sun, 09 Mar 1997 09:50:39 +0000
parents 7c60f8a6e6a0
children eedc2f3f61f7
line wrap: on
line diff
--- a/src/xpow.cc	Sat Mar 08 08:41:00 1997 +0000
+++ b/src/xpow.cc	Sun Mar 09 09:50:39 1997 +0000
@@ -65,7 +65,7 @@
 octave_value
 xpow (double a, double b)
 {
-  if (a < 0.0 && (int) b != b)
+  if (a < 0.0 && static_cast<int> (b) != b)
     {
       Complex atmp (a);
       return pow (atmp, b);
@@ -163,9 +163,9 @@
     error ("for A^b, A must be square");
   else
     {
-      if ((int) b == b)
+      if (static_cast<int> (b) == b)
 	{
-	  int btmp = (int) b;
+	  int btmp = b;
 	  if (btmp == 0)
 	    {
 	      retval = DiagMatrix (nr, nr, 1.0);
@@ -253,7 +253,7 @@
   Complex result;
 
   if (xisint (b))
-    result = pow (a, (int) b);
+    result = pow (a, static_cast<int> (b));
   else
     result = pow (a, b);
 
@@ -348,9 +348,9 @@
     error ("for A^b, A must be square");
   else
     {
-      if ((int) b == b)
+      if (static_cast<int> (b) == b)
 	{
-	  int btmp = (int) b;
+	  int btmp = b;
 	  if (btmp == 0)
 	    {
 	      retval = DiagMatrix (nr, nr, 1.0);
@@ -504,7 +504,7 @@
   int nr = a.rows ();
   int nc = a.cols ();
 
-  if ((int) b != b && a.any_element_is_negative ())
+  if (static_cast<int> (b) != b && a.any_element_is_negative ())
     {
       ComplexMatrix result (nr, nc);
       for (int j = 0; j < nc; j++)
@@ -553,7 +553,7 @@
       {
 	double atmp = a (i, j);
 	double btmp = b (i, j);
-	if (atmp < 0.0 && (int) btmp != btmp)
+	if (atmp < 0.0 && static_cast<int> (btmp) != btmp)
 	  {
 	    convert_to_complex = 1;
 	    goto done;
@@ -642,7 +642,7 @@
       {
 	double btmp = b (i, j);
 	if (xisint (btmp))
-	  result (i, j) = pow (a, (int) btmp);
+	  result (i, j) = pow (a, static_cast<int> (btmp));
 	else
 	  result (i, j) = pow (a, btmp);
       }
@@ -678,7 +678,7 @@
     {
       for (int j = 0; j < nc; j++)
 	for (int i = 0; i < nr; i++)
-	  result (i, j) = pow (a (i, j), (int) b);
+	  result (i, j) = pow (a (i, j), static_cast<int> (b));
     }
   else
     {
@@ -712,7 +712,7 @@
       {
 	double btmp = b (i, j);
 	if (xisint (btmp))
-	  result (i, j) = pow (a (i, j), (int) btmp);
+	  result (i, j) = pow (a (i, j), static_cast<int> (btmp));
 	else
 	  result (i, j) = pow (a (i, j), btmp);
       }