ClojureScript

mod not correctly implemented visavi negative num or div

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

user=> (map #(mod % 2) (range -2 3))
(0 1 0 1 0)
user=> (map #(mod % -2) (range -2 3))
(0 -1 0 -1 0)

ClojureScript:cljs.user> (map #(mod % 2) (range -2 3))
(0 -1 0 1 0)
ClojureScript:cljs.user> (map #(mod % -2) (range -2 3))
(0 -1 0 1 0)

Activity

Hide
David Nolen added a comment -

This an artifact of the fact that mod simply uses JavaScript's mod operator. It's not clear to me yet what ClojureScript's numeric stance is w/ respect to JavaScript.

Show
David Nolen added a comment - This an artifact of the fact that mod simply uses JavaScript's mod operator. It's not clear to me yet what ClojureScript's numeric stance is w/ respect to JavaScript.
Hide
David Nolen added a comment -

Declined - numerics discussion needs to happen first.

Show
David Nolen added a comment - Declined - numerics discussion needs to happen first.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: