[C#]Fibonacci Sequence

Results 1 to 8 of 8
  1. #1
    Account Upgraded | Title Enabled! Intelext is offline
    MemberRank
    Mar 2007 Join Date
    EuropeLocation
    1,228Posts

    [C#]Fibonacci Sequence

    Very cool way to create a exp formulas. I am using it for my game witch is in development now.


    PHP Code:
    static void Main(string[] args)
            {
                
    Console.Title "Fibonacci Sequence";
                
    Console.ForegroundColor ConsoleColor.Green;
                
    Int64 A 110;
                
    int I 1;

                while (
    32 )
                {
                    
    B;
                    
    B;
                    
    C;

                    
    Console.WriteLine(C);
                    
    I++;
                }

                
    Console.ReadLine();
            } 


  2. #2
    The Gamma..? EliteGM is offline
    MemberRank
    Jul 2006 Join Date
    NandolandLocation
    4,077Posts

    Re: [C#]Fibonacci Sequence

    Hmm let's give it a try *opens C#*
    Sec. plx

  3. #3
    Account Upgraded | Title Enabled! Intelext is offline
    MemberRank
    Mar 2007 Join Date
    EuropeLocation
    1,228Posts

    Re: [C#]Fibonacci Sequence

    Quote Originally Posted by EliteGM View Post
    Hmm let's give it a try *opens C#*
    Sec. plx
    use int instead of int64 if you are running on a 32bit OS.

    Not sure, but I think int64 might not work on 32bit OS.

  4. #4
    The Gamma..? EliteGM is offline
    MemberRank
    Jul 2006 Join Date
    NandolandLocation
    4,077Posts

    Re: [C#]Fibonacci Sequence

    Ooh
    Idk how it works but those numbers are.. cool in some way

  5. #5
    Member EvilMortal is offline
    MemberRank
    Nov 2006 Join Date
    85Posts

    Re: [C#]Fibonacci Sequence

    int64 works on 32bit -_-
    its 8 bytes number

  6. #6
    Account Upgraded | Title Enabled! Intelext is offline
    MemberRank
    Mar 2007 Join Date
    EuropeLocation
    1,228Posts

    Re: [C#]Fibonacci Sequence

    No it does not. I tried it on my friends notebook and it did not went past in32 range. Variable can be int64 but the capability will not get past 32bit integer.

  7. #7
    Account Upgraded | Title Enabled! King Izu is offline
    MemberRank
    Dec 2006 Join Date
    833Posts

    Re: [C#]Fibonacci Sequence

    Quote Originally Posted by Intelext View Post
    No it does not. I tried it on my friends notebook and it did not went past in32 range. Variable can be int64 but the capability will not get past 32bit integer.
    Yes it certainly does, the name is Int64 for a very good reason, that reason being it's a 64bit integer. Regardless of whether you're on a 32 bit platform or a 64 bit, Int64 will always be 64 bits.

    PHP Code:
    using System;

    class 
    Test
    {
        public static 
    void Main(string[] argv)
        {
            
    long int64 0x1000000000000000;
            
    Console.WriteLine(int64 1);
            
    Console.ReadLine();
        }

    Will work exactly the same regardless of whether or not you're using a 32 bit or 64 bit system.

  8. #8
    Account Upgraded | Title Enabled! Intelext is offline
    MemberRank
    Mar 2007 Join Date
    EuropeLocation
    1,228Posts

    Re: [C#]Fibonacci Sequence

    Oh yes. You were right IDD. Sorry for my mistake. :)

    I tested it and it was same. :)

    Again, sorry for mistake. =)



Advertisement