Jump to content

Very big number?

- - - - -

  • Please log in to reply
35 replies to this topic

#1
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
I want to have 65536! (factorial)
but I can not do it with double and long.
How can I have it in numeric view?


(How can I have 14!/6555! two?)

Edited by Hamed, 22 November 2010 - 08:06 AM.


#2
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 762 posts
Use record or array and few routines to do basic calculations and format conversion (for such large numbers, i think you only need to string or from string conversions :) ). They do it all the time with Asymetrical encryption, for example RSA 256 bit, you need 256 bit (32 bytes) integer which I believe is not natively available in any language.

[Edit: addition]Or you can use strings for as mediator, although I don't really like it but I have seen it implemented this way.

Edited by LuthfiHakim, 19 November 2010 - 08:25 AM.
Add new alternative


#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
GMP is very useful. Basically, you need to use a struct/class to represent it.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
How can I use GMP?
Where can I download it?
I am using Dev-C++ now after installing GMP I get these error when I want to compile?

Attached Files


Edited by Hamed, 19 November 2010 - 10:30 AM.


#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
You may have to run ./configure and make to build it.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
How to run ./configure ?
I am new to Dev-C++.

#7
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
You may have to download sysdev from the MinGW tools. Also, Dev-C++ comes with a very old version of the MinGW compiler. You should at least upgrade to wxDev-C++
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#8
mebob

mebob

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
WingedPanther is right about Dev-C++ coming with a really old version of MinGW. I would suggest a different IDE, such as Code::Blocks, but that is up to you.
As for running the configure shell script, you would want to download MSYS for MinGW. It is basically a shell for MinGW. Here is a link for download and installation directions: MSYS | MinGW
Latinamne loqueris?

#9
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
codeblocks-10.05mingw-setup.exe
I download this version and please guide me to use for GMP.

Does codeblocks has integrated compiler?

I have VC.Net 2008 but I don't know how to install GMP in VC.net.

#10
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
In CodeBlock I get this error:
"hg - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done.
When I want to compile simple projects.

#11
mebob

mebob

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
Make sure the compiler options points to the right MinGW path. MinGW is probably in the root of your main drive, unless you told the installer to put it elsewhere.

You can also have Code::Blocks use your VC++ compiler if you want it to.
Latinamne loqueris?

#12
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
This my config!
I have MinGW in c drive but I can not use it!!!
Where can I change MinGW address?

Attached Files






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users