Skip to content

Commit

Permalink
doc manual noteworthy diff from C: division (JuliaLang#38174)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethomag authored Oct 27, 2020
1 parent 6312bfe commit 861f8d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/src/manual/noteworthy-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ For users coming to Julia from R, these are some noteworthy differences:
literals are rounded (and not promoted to the `BigFloat` type) if they can not be exactly represented.
Floating point literals are closer in behavior to C/C++. Octal (prefixed with `0o`) and binary
(prefixed with `0b`) literals are also treated as unsigned (or `BigInt` for more than 128 bits).
* In Julia, the division operator [`/`](@ref) returns a floating point number when both operands
are of integer type. To perform integer division, use [`div`](@ref) or [`÷`](@ref div).
* Indexing an `Array` with floating point types is generally an error in Julia. The Julia
equivalent of the C expression `a[i / 2]` is `a[i ÷ 2 + 1]`, where `i` is of integer type.
* String literals can be delimited with either `"` or `"""`, `"""` delimited literals can contain
`"` characters without quoting it like `"\""`. String literals can have values of other variables
or expressions interpolated into them, indicated by `$variablename` or `$(expression)`, which
Expand Down

0 comments on commit 861f8d6

Please sign in to comment.