GetSign
Result = GetSign(Value)
 
Parameters:

    Value = The value to test
Returns:

    Result
 

GetSign returns the sign bit from a given integer value. Therefore, if the value is negative (Has it's High Bit set) it'll return 1, otherwise it'll returns 0.




Mini Tutorial:


Showing the use of the GetSign function


  
  Print GetSign(-32)
  Print GetSign(12)
  Print GetSign(0)
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  




This example would output.

  
  1
  0
  0
  

 
Related Info: And | Neg | TestBit :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com