Skip to content

Division operator (/) and int.divide have different behavior. #4733

Discussion options

You must be logged in to vote
  1. No, we would not change the behaviour of int.divide now. This would be quite a large breaking change and break many existing packages. It's meant to be a different API from the division operator, so that you can either have absolute safety and get an Error when the division fails, or not have to think about it and just receive zero.
  2. No, operators are not values, they are just syntax. If you want to pass an operator like this, I suggest you use an anonymous function: fn(a, b) { a / b }
  3. String padding functions are in almost every language I know and their purpose is always the same: Pad a string until it is at least a certain length. If you want to pad a fixed length, you should use strin…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TrentSlaton
Comment options

Answer selected by TrentSlaton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants