sauron271's blog

By sauron271, history, 12 hours ago, In English

Is __int 128 the largest data type in cpp or is there something bigger?

  • Vote: I like it
  • -5
  • Vote: I do not like it

»
11 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

A custom one called BigInt

»
11 hours ago, # |
  Vote: I like it -18 Vote: I do not like it

is this a good answer .

Spoiler
  • »
    »
    11 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    some times it is needed you shouldn't use it all the time but some problems require it where big multiplication or big numbers or other factors come into account

    • »
      »
      »
      11 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      personally i prefer long double over __int128

      the only time i saw __int128 being used was when declaring a very big prime to use it as mod . But that was only one problem with so many other solutions without __int128

      • »
        »
        »
        »
        10 hours ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        I've only used int 128 when you have to find a number bigger than 2^64 that you eventually take modulo a prime, then convert it into long long.

        For example:

        __int128 n=1000000000000000000000000; //example

        n%=998244353;

        long long n2=n;

        cout<<n2<<endl;

»
9 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Check out the Boost library. You can't use it for CF though.