I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 2.09
sub units 0.00
+
0

add

viewed 8766 times and licensed 73 times
Performs the addition of two long positive integers in the given base.
Controller: CodeCogs

get GPL add to cart

Interface

C++
Excel

Add

 
std::stringaddstd::stringa
std::stringb
intbase = 10 )
This function calculates the addition of two long positive integers stored as character strings, in the given numerical base. The maximum number of digits of either the numbers is only limited by the amount of memory available.

Example:

#include <codecogs/maths/arithmetic/add.h>
#include <iostream>
 
int main()
{
  std::string a("2323"), b("1747"),
  c = Maths::Arithmetic::add(a, b, 8);
  std::cout << "The following is a base 8 operation" << std::endl;
  std::cout << a << " + " << b << " = " << c << std::endl;
  return 0;
}

Output:

The following is a base 8 operation
2323 + 1747 = 4272

Parameters

athe first term
bthe second term
baseDefault value = 10

Returns

a character string corresponding to the sum of the given numbers

Authors

Anca Filibiu and Lucian Bentea (September 2005)
Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.