You are not logged in. Please login at www.codechef.com to post your questions!

×

How to store big values like pow(9,4000) ?

i want to store value of pow(9,4000) to a variable " num " but i don't know how to store such a large value what data type should i use, i already tried to use unsigned long long int num; but it shows 0 any solution C++ 4.8.1

asked 17 Nov '14, 13:10

keshav2010's gravatar image

2★keshav2010
11
accept rate: 0%


You are asking question from an ongoing contest.(PPOW from CodeSmart 2014). Please refrain.

link

answered 18 Nov '14, 18:45

himanshujaju's gravatar image

6★himanshujaju
251310
accept rate: 0%

You cannot do that simply. You can store its digits individually in a string/array though..

link

answered 17 Nov '14, 13:41

pranjalranjan's gravatar image

4★pranjalranjan
2.0k21432
accept rate: 20%

as u are using c++ u can even use vector stl.Offers a better option as adding digits and other operations are easier.

link

answered 18 Nov '14, 18:36

checkashu's gravatar image

3★checkashu
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,687
×52
×51
×24

question asked: 17 Nov '14, 13:10

question was seen: 2,215 times

last updated: 18 Nov '14, 18:45