• Skip to primary navigation
  • Skip to content
  • Skip to footer
Clojure Diary Clojure Diary
  • Search
  • Book
  • Code
  • Videos
  • Donate

    Number comparison gotchas in Clojure

    less than 1 minute read

    Notes

    ;; number_comparison_gotchas.clj
    
    (= 7 7)
    
    (= 7 7.0)
    
    (= (double 7) 7.0)
    
    (= 7.0 7.0)
    
    (= 7 7.0M)
    
    (= 7.0 7.0M)
    
    (= 7.0 (double 7.0M))
    
    (= 7 7/1)
    
    (double 1/3)

    Updated: January 20, 2024

    Twitter Facebook LinkedIn
    Previous Next

    You May Also Enjoy

    Creating code on the fly using Clojure eval

    less than 1 minute read

    Mount - Clojure State Management

    less than 1 minute read

    Commenting, i.e. adding docstrings to multimethods in Clojure

    less than 1 minute read

    Rant about strings. About comment, and work around to comment multimethods

    1 minute read

    • Feed
    © 2025 Clojure Diary. Powered by Jekyll & Minimal Mistakes.