i'm really confused
when you use Hex with 65535 it'll return FFFF (that's no problem )
but the problem is when you try with -1, it'll also return FFFF
VB Code:
  1. Debug.Print Hex(-1)
  2. 'This will retrun FFFF
  3. Debug.Print Hex(65535)
  4. 'This will return FFFF too
  5. 'Or another way
  6. Debug.Print Hex(-1) = Hex(65535)
  7. 'this will return true
  8. 'i know this seems confusing (the =) but here the = is conditional
  9. 'it's not a = of a set statement (there is no problem with this = )
what's the problem ???
is it right mathematically ???
well i think it isn't right mathematically cause from my experience maths are always logical , and this is not logical beacause when you try to do the conversion in the other direction (Hexadecimal --> Decimal ) you won't know whether the origin was 65535 or -1

and another reson for findinf it not logical is that when using the classical way of converting any base to base 10 ( the number in the column from the right * the base ^ (The column number -1 ) + the same thing) you'll get that FFFF is 65535 not -1 but Val ("&HFFFF") = -1
VB Code:
  1. 'the way of converting, it'll work with bases < 10
  2. dim TheLastNumber
  3. for i = 0 to len ( TheNumber) -1
  4.    TheLastNumber = TheLastNumber + (mid(TheNumber , len(theNumber) -i ,1) ^ i)
  5. next i
Very confused

BTW the same thing happens with OCT
VB Code:
  1. Debug.print Oct(-1) = Oct(65535)
  2. 'this will return true

any help ?????