Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8041813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:21:02+00:00 2026-06-05T04:21:02+00:00

#include <stdio.h> int main() { long double n = (long double)1208925819614629174706175; // (1<<80)-1 (generated

  • 0
#include <stdio.h>

int main()
{
    long double n = (long double)1208925819614629174706175; // (1<<80)-1 (generated in python)
    printf("%LG\n",n);
}

On compiling this with gcc, I get a warning

test.c:5:31: warning: integer constant is too large for its type [enabled by default]

On running it prints -1

On doing a sizeof(long double), it prints 12.
So a signed long double should accomodate (1<<83)-1 right?

How do I get it working correctly?

PS: The original problem I was working on, dealt with storing signed integers as large as 12*(1018). I don’t want to write multiplication, addition, and other calculation routines. So how do I do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:21:04+00:00Added an answer on June 5, 2026 at 4:21 am

    Long double will handle 10**300 and above, that’s not what the compiler is complaining about. It says the integer that you are trying to cast into a long is too big for an integer. ( hint – add a decimal point ) – starbolin
     

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include<stdio.h> #include<time.h> int main() { clock_t start; double d; long int n,i,j; scanf(%ld,&n); n=100000;
user@user:~/langs/c$ cat 3264int.c #include <stdio.h> int main(){ long z; printf(Long int size is %d
#include <stdio.h> int main(void) { double resd = 0.000116; long long resi = 0;
#include<math.h> #include<stdio.h> int main() { long i,j[100000],k,l,T,a,n[100000],c,sum=0,m; scanf(%ld\n, &T); for(c=1; c<=T; c++) { n[c]
#include <stdio.h> int main(int argc, char *argv[]) { long* fp; while(1) { fp =
#include<stdio.h> int main() { int i=0; printf(%d:%4d\n,++i,'\1'); printf(%d:%4d\n,++i,'\2'); printf(%d:%4d\n,++i,'\3'); printf(%d:%4d\n,++i,'\4'); printf(%d:%4d\n,++i,'\5'); printf(%d:%4d\n,++i,'\6'); printf(%d:%4d\n,++i,'\7'); printf(%d:%4d\n,++i,'\8');
#include <stdio.h> int main(){ char *c=; printf(Input: ); scanf_s(%c, c); printf(%x, *c); } I
#include <stdio.h> int main(void) { int i,j,k; char st; printf(enter string\n); scanf(%s, st); printf(the
#include <stdio.h> int main() { float a = 1234.5f; printf(%d\n, a); return 0; }
#include<stdio.h> int main() { printf(He %c llo,65); } Output: He A llo #include<stdio.h> int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.