Thread: Giant numbers?

  1. #1
    60% Braindead
    Join Date
    Dec 2005
    Posts
    379

    Giant numbers?

    Ok, before you say
    http://www.swox.com/gmp/
    That doesnt work. The number is to large for it to calculate -,-.

    You might be wondering what it is, it just so happens to be:
    299,792,458^2.

    Oh yes. Its big. Its also known as Speed Of Light Squared (Now I know why nobody says what that number is :P) I know the number is:

    90,000,000,000,000 but, I cant tell my computer to hold that value (Yes, thats 90 quadrillion, I'm fairly sure thats rounded though).

    So, is their anything thats even larger than swox's? Will an average computer be able to calculate it? -,-. I'm not to concerened with calculating speed, I just need to get the number.

    Thank you .
    Code:
    Error W8057 C:\\Life.cpp: Invalid number of arguments in function run(Brain *)

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Code:
    #include <iostream>
    #include <float.h>
    
    int main()
    {
    	std::cout << DBL_MAX;
    	return 0;
    }
    Don't give me that. The world is full of very large numbers, but we seem to do a pretty good job with dealing.

  3. #3
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    89875517873681764

    Edit
    BTW, gmp can most definitely handle that, just without the commas

  4. #4
    60% Braindead
    Join Date
    Dec 2005
    Posts
    379
    I had put in commas -,-.

    Lol yeah, it can handle:
    299792458^100

    So it can definantly handle the square -,-.

    Wow.... It took:

    299792458^10011

    O_o.
    Last edited by Blackroot; 01-26-2006 at 08:06 PM.
    Code:
    Error W8057 C:\\Life.cpp: Invalid number of arguments in function run(Brain *)

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    203
    a long long is -9 quintillion to +9 quintillion i think

  6. #6
    Registered User
    Join Date
    Jan 2006
    Posts
    20
    You know, a long double's range is: 3.4^-4932 to 3.4^4932. So I don't think it will be a problem. I'd use long though.

  7. #7
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    I wonder if logical ray-tracing achieves those speeds?

    I guess any command can only move as fast as electricity allows...

    So I would assume that tracing a beam of light and calculating its reactions to surfaces would be in now way even CLOSE to the speed of light...

    90 quadrillion, that is as instantaneous as instantaneous can get.



    Are the mathematics involved in physics as arbitrary as languages and words we assign objects?

    Because obviously, nothing is calculating the way light reacts to things mathematically, it just happens, instantaneously, or at least at 90 quadrillion (what is it? MPH?)

    Or is it? Matrix anyone?
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  8. #8
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Quote Originally Posted by Shamino
    I wonder if logical ray-tracing achieves those speeds?

    I guess any command can only move as fast as electricity allows...

    So I would assume that tracing a beam of light and calculating its reactions to surfaces would be in now way even CLOSE to the speed of light...

    90 quadrillion, that is as instantaneous as instantaneous can get.

    Are the mathematics involved in physics as arbitrary as languages and words we assign objects?

    Because obviously, nothing is calculating the way light reacts to things mathematically, it just happens, instantaneously, or at least at 90 quadrillion (what is it? MPH?)

    Or is it? Matrix anyone?
    The speed of light is 299,792,458 m/s (3.0x10^8), not 90 quadrillion (thats the speed of light squared, probably for einstein's e=mc^2).

    Plenty of equations are based on the speed of light. Even if the number was that big, in physics the correct value would be used. Just look at G (6.67x10^-11), and thats a simple one used in first-year Physics.

    As for these constants in game programming (gravity, light, forces, etc), I've read they are modified to logical numbers, depending on frames/sec, etc. Otherwise its most likely just programmed as instantaneous (you know light would have travelled around your game world 1000 times before the next frame, so why bother).
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Writing unique numbers to an array
    By yardy in forum C Programming
    Replies: 6
    Last Post: 12-27-2006, 09:15 PM
  2. Comparing numbers to a list of numbers held in a text file
    By jmajeremy in forum C++ Programming
    Replies: 3
    Last Post: 11-06-2006, 07:56 AM
  3. Logical errors with seach function
    By Taka in forum C Programming
    Replies: 4
    Last Post: 09-18-2006, 05:20 AM
  4. the definition of a mathematical "average" or "mean"
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 12-03-2002, 11:15 AM
  5. A (complex) question on numbers
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 02-03-2002, 06:38 PM