Search code examples
cdoublelong-doublevariable-types

What's bigger than a long double?


So I'm trying to find the result of 1.25 ÷ (2 ✕ 10^-12). I first tried doing it with python, but the result was too big it returned a negative number. So I tried doing it in C, using a long double, but it's still not enough.

PS. I'm using GCC v9.2.1 on Linux Ubuntu


Solution

  • long long won't go bigger than a long double, but for your calculation, it's fine:

    #include "stdio.h"
    int main(){
        long long a = 1.25 / 2e-12;
        printf("%lld\n", a);
    }
    

    This prints 625000000000 for me.