document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. puts(1+1) // addition
  2.  
  3. puts(1-1)
  4.  
  5. puts(1/2) // prints 0
  6.  
  7. puts(1/2.0) // prints 0.5
  8.  
  9. /*
  10.    operations:
  11.    
  12.    int [op] float -> float
  13.    float [op] int -> float
  14.    int [op] int -> int
  15.    float [op] float -> float
  16. */
  17.  
  18. puts(3*3.1)
  19.  
  20. puts("hi"*3) // prints hihihi
  21.  
  22. puts(2**3)   // prints 8 (power)
  23.  
  24. puts(!!5)    // prints 120 (factorial)
  25.  
  26. /*
  27.    boolean data types:
  28.    0 means false
  29.    any other number means true
  30. */
  31.  
  32. x = "hi" === 3 // === tests if the 2 values have the same type
  33. puts(x)         // prints 0 because the "hi" !== 3 !
  34.  
  35. /*
  36. === console output: ===
  37. 2
  38. 0
  39. 0
  40. 0.500000
  41. 9.299999
  42. hihihi
  43. 8
  44. 120
  45. 0
  46. */
');