SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    http://TheICE.co.uk/ The Eerie Network's Avatar
    Join Date
    Apr 2001
    Location
    London in the UK.
    Posts
    293
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After asking just about everyone I know, and finding out I can't store numbers large enough in variables, I've decided to work with Hex numbers.

    however my problems is that i I need to be able to do simple sums on the numbers, but I don't know how to do this, or if it's a hard or easy thing to do?

    Also, as Hex is a mixture of numbers and letters, what vartype should i store them im?

    Thanx guys ;-)
    Daniel Hollands
    New: My Webcam <-- Come and watch me doing what I do
    TheICE.co.uk <-- New sites for the best in UK lifestyle and Competitions.
    The ofDan.Network Forums <-- Come and join in the fun.

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see why would you want to use HEX as input or store it in variables, only when you try to use low level language (like Assembly)
    To sum them, just imagine you're in base-16 world, and not base-10 (decimal)like we're in now. Everything follows.
    Code:
    Eg: sum in HEX
    38
    1C
    --
    54 
    Explanations:
    8+C = 20 in base 16 is 4, remember 1
    3+1 = 4 plus 1 remember = 5
    I guess if you want, you could use string to implement.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •