String Manipulation

Dividing large numbers

Page 1 of 1

3 Replies - 1608 Views - Last Post: 31 August 2010 - 12:15 AM Rate Topic: -----

#1 Circuit_Girl  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 34
  • Joined: 25-February 09

String Manipulation

Posted 29 August 2010 - 02:25 PM

I wanted to play around with using string manipulation to divide very large numbers.

I will have a very simple input of the dividend and divisor and my program will print out the quotient and remainder. I will also be giving inputs with leading zeros but I will not include them in my output.

How would I accomplish this using string manipulation?

Thanks for your help.
Is This A Good Question/Topic? 0
  • +

Replies To: String Manipulation

#2 taylorc8  Icon User is offline

  • B&

Reputation: 149
  • View blog
  • Posts: 1,572
  • Joined: 21-July 09

Re: String Manipulation

Posted 29 August 2010 - 02:27 PM

Maybe take a look at a library that already exists for doing that,
Was This Post Helpful? 0
  • +
  • -

#3 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3116
  • View blog
  • Posts: 19,153
  • Joined: 14-September 07

Re: String Manipulation

Posted 29 August 2010 - 02:30 PM

David W has a few snippets that handle large numbers as Strings, check out his contribution page.
Was This Post Helpful? 0
  • +
  • -

#4 buffalobill  Icon User is offline

  • D.I.C Head

Reputation: 21
  • View blog
  • Posts: 188
  • Joined: 08-July 08

Re: String Manipulation

Posted 31 August 2010 - 12:15 AM

Do you mean:
if
char s1="123456789"
char s2="965412378"
find the approximate value of 965412378/123456789 = 7.82
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1