arithmetic_vars.ion 537 B

123456789101112131415161718192021222324252627282930313233
  1. echo '# ANCHOR: individual_assignments'
  2. let value = 5
  3. echo $value
  4. let value += 5
  5. echo $value
  6. let value -= 2
  7. echo $value
  8. let value *= 2
  9. echo $value
  10. let value //= 2
  11. echo $value
  12. let value **= 2
  13. echo $value
  14. let value /= 2
  15. echo $value
  16. echo '# ANCHOR_END: individual_assignments'
  17. echo '# ANCHOR: multiple_assignments'
  18. let a b = 5 5
  19. echo $a $b
  20. let a b += 5 5
  21. echo $a $b
  22. let a b -= 2 2
  23. echo $a $b
  24. let a b *= 2 2
  25. echo $a $b
  26. let a b //= 2 2
  27. echo $a $b
  28. let a b **= 2 2
  29. echo $a $b
  30. let a b /= 2 2
  31. echo $a $b
  32. echo '# ANCHOR_END: multiple_assignments'