home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / StdEnv / StdInt.dcl < prev    next >
Encoding:
Text File  |  1996-12-23  |  1.6 KB  |  58 lines  |  [TEXT/3PRM]

  1. system module StdInt 
  2.  
  3. // ****************************************************************************************
  4. //    Concurrent Clean Standard Library Module Version 1.1
  5. //    Copyright 1995 University of Nijmegen
  6. // ****************************************************************************************
  7.  
  8. import    StdOverloaded
  9.  
  10. instance +                Int
  11.  
  12. instance -              Int
  13. instance zero            Int
  14.  
  15. instance *              Int
  16. instance /                Int
  17. instance one            Int
  18.  
  19. instance ^                Int
  20. instance abs            Int
  21. instance sign            Int
  22. instance ~                Int
  23.  
  24. instance ==                Int
  25.  
  26. instance <              Int
  27.  
  28. instance toInt            Int
  29. instance toChar            Int
  30. instance toReal            Int
  31. instance toString        Int
  32.  
  33. instance fromInt        Int
  34. instance fromInt        Char
  35. instance fromInt        Real
  36. instance fromInt        {#Char}
  37.  
  38. // Additional functions for integer arithmetic: 
  39.  
  40. (mod)    infix  7    :: !Int !Int    ->    Int     //    arg1 modulo arg2
  41. (rem)    infix  7    :: !Int !Int    ->    Int     //    remainder after integer division
  42. gcd                 :: !Int !Int     ->    Int        //    Greatest common divider
  43. lcm                 ::  Int !Int    ->    Int        //    Least common multiple
  44.  
  45. //    Test on Integers:
  46.  
  47. isEven                 :: !Int         ->    Bool    //    True if arg1 is an even number
  48. isOdd                 :: !Int         ->    Bool    //    True if arg1 is an odd  number
  49.  
  50. //    Operators on Bits:
  51.  
  52. (bitor)    infixl  6    :: !Int !Int     ->    Int     //    Bitwise Or of arg1 and arg2
  53. (bitand) infixl 6    :: !Int !Int     ->    Int     //    Bitwise And of arg1 and arg2
  54. (bitxor) infixl 6    :: !Int !Int     ->    Int     //    Exclusive-Or arg1 with mask arg2
  55. (<<)    infix  7    :: !Int !Int     ->    Int     //    Shift arg1 to the left arg2 bit places
  56. (>>)    infix  7    :: !Int !Int     ->    Int     //    Shift arg1 to the right arg2 bit places
  57. bitnot                :: !Int         ->    Int     //    One's complement of arg1
  58.