X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Futils.cpp;h=7592e4033e8ef6ae7d0eadcb1fffe10102ab7db2;hp=69d4f46110dc43e5a50f717d82bb1d834334c20d;hb=afdd7fa8c6c0a587f7c80789198551383e8beb7b;hpb=a8507b8af1c08d9b27d98d57f95c7ca1a8671e27;ds=sidebyside diff --git a/ginac/utils.cpp b/ginac/utils.cpp index 69d4f461..7592e403 100644 --- a/ginac/utils.cpp +++ b/ginac/utils.cpp @@ -1,7 +1,8 @@ /** @file utils.cpp * - * Implementation of several small and furry utilities. - * + * Implementation of several small and furry utilities. */ + +/* * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify @@ -19,6 +20,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "utils.h" + +#ifndef NO_GINAC_NAMESPACE +namespace GiNaC { +#endif // ndef NO_GINAC_NAMESPACE + +/** Integer binary logarithm */ unsigned log2(unsigned n) { unsigned k; @@ -26,6 +34,8 @@ unsigned log2(unsigned n) return k; } +/** Compare two pointers (just to establish some sort of canonical order). + * @return -1, 0, or 1 */ int compare_pointers(void const * a, void const * b) { if (a