Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Division by two
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Binary floating point== In binary [[floating-point arithmetic]], division by two can be performed by decreasing the exponent by one (as long as the result is not a [[subnormal number]]). Many programming languages provide functions that can be used to divide a floating point number by a power of two. For example, the [[Java (programming language)|Java programming language]] provides the method <code>java.lang.Math.scalb</code> for scaling by a power of two,<ref>{{cite web |url=http://java.sun.com/javase/6/docs/api/java/lang/Math.html#scalb(double,%20int) |title=Math.scalb |work=Java Platform Standard Ed. 6 |accessdate=2009-10-11 }}</ref> and the [[C (programming language)|C programming language]] provides the function <code>ldexp</code> for the same purpose.<ref>{{citation |title=Programming languages β C, International Standard ISO/IEC 9899:1999 }}, Section 7.12.6.6.</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)