]> www.ginac.de Git - ginac.git/blobdiff - ginac/power.h
documentation update
[ginac.git] / ginac / power.h
index 952a72a6e56622fc3b8fdb8959a1c9edf29a524c..12ebf6a2aa896bedcd271c7ac865e1df977a4502 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to GiNaC's symbolic exponentiation (basis^exponent). */
 
 /*
- *  GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -46,7 +46,7 @@ public:
        power(const ex & lh, const ex & rh) : inherited(TINFO_power), basis(lh), exponent(rh) {}
        template<typename T> power(const ex & lh, const T & rh) : inherited(TINFO_power), basis(lh), exponent(rh) {}
        
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
        unsigned precedence(void) const {return 60;}
@@ -90,13 +90,6 @@ protected:
 
 // utility functions
 
-/** Return the power object handled by an ex.  Deprecated: use ex_to<power>().
- *  This is unsafe: you need to check the type first. */
-inline const power &ex_to_power(const ex &e)
-{
-       return static_cast<const power &>(*e.bp);
-}
-
 /** Efficient specialization of is_exactly_a<power>(obj) for power objects. */
 template<> inline bool is_exactly_a<power>(const basic & obj)
 {
@@ -120,7 +113,11 @@ inline ex pow(const T1 & b, const T2 & e)
 }
 
 /** Square root expression.  Returns a power-object with exponent 1/2. */
-ex sqrt(const ex & a);
+inline ex sqrt(const ex & a)
+{
+       extern const ex _ex1_2;
+       return power(a,_ex1_2);
+}
 
 } // namespace GiNaC