Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

Base32.h File Reference

#include <iostream>
#include <cstdlib>
#include <string.h>
#include <assert.h>
#include <stddef.h>

Go to the source code of this file.

Namespaces

namespace  std

Classes

class  Base32

Functions

int divceil (int a, int b)


Function Documentation

int divceil int  a,
int  b
 

Copyright (c) 2002 Bryce "Zooko" Wilcox-O'Hearn Permission is hereby granted, free of charge, to any person obtaining a copy of this software to deal in this software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of this software, and to permit persons to whom this software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of this software.

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THIS SOFTWARE OR THE USE OR OTHER DEALINGS IN THIS SOFTWARE.

Converted to C++ by:

Author:
Werner Dittmann <Werner.Dittmann@t-online.de>

Definition at line 26 of file Base32.cxx.

Referenced by Base32::a2b_l(), Base32::b2a_l(), Base32::b2alen(), and Base32::Base32().

00026                           {
00027     int c;
00028     if (a>0) {
00029         if (b>0) c=a+b-1;
00030         else c=a;
00031     } else {
00032         if (b>0) c=a;
00033         else c=a+b+1;
00034     }
00035     return c/b;
00036 }


© sourcejam.com 2005-2008