8000 Fix examples for multiplication and division by jlnr · Pull Request #2 · jtwig/book · GitHub
[go: up one dir, main page]

Skip to content

Fix examples for multiplication and division - #2

Open
jlnr wants to merge 1 commit into
jtwig:masterfrom
jlnr:patch-1
Open

jlnr wants to merge 1 commit into
jtwig:masterfrom
jlnr:patch-1

Conversation

@jlnr
@jlnr jlnr commented Dec 11, 2017 •
Copy link
Copy Markdown

I've avoided using 2.x ** 2.x == 4.x in the examples because readers might mistake ** for exponentiation. 2 ** 2 == 4 happens to be true in many programming languages, but for other reasons.

And I think it is clearer now that ** and // truncate the operands, not the result. This is different from e.g. Pascal's div operator for integer division.

I've also avoided using 2.x ** 2.x == 4.x in an example because readers might mistake `**` for exponentiation -- `2 ** 2 == 4` happens to be true in most languages, but for other reasons.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0