Skip to content

Fixed float reference page. #625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Language/Variables/Data Types/float.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,7 @@ x = 1;
y = x / 2; // y now contains 0, ints can't hold fractions
z = (float)x / 2.0; // z now contains .5 (you have to use 2.0, not 2)
----


--
// HOW TO USE SECTION ENDS


// SEE ALSO SECTION STARTS
[#see_also]
--
[%hardbreaks]

[float]
=== Notes and Warnings
Expand Down Expand Up @@ -99,6 +91,16 @@ int y = round(x); // 3

Floating point math is also much slower than integer math in performing calculations, so should be avoided if, for example, a loop has to run at top speed for a critical timing function. Programmers often go to some lengths to convert floating point calculations to integer math to increase speed.

--
// HOW TO USE SECTION ENDS




// SEE ALSO SECTION STARTS
[#see_also]
--

[%hardbreaks]
[float]
=== See also
Expand Down