How to calculate floating point numbers?How to calculate a floating point of negative number?Data Representation QuestionFloating Point CalculationHow are floating-point numbers logarithmically distributed?Floating point representation in 8 bitWhat is the second smallest C single precision positive floating number there is? (IEEE754)Floating point representationHow many bits to represent these numbers precisely?Floating Point Numbers - Machine numbersAdding two IEEE754 floating-point representations and interpreting the result.
PTIJ: Which Dr. Seuss books should one obtain?
Deciphering cause of death?
Proving an identity involving cross products and coplanar vectors
Is there a way to play vibrato on the piano?
How to leave product feedback on macOS?
How many people need to be born every 8 years to sustain population?
Is there a distance limit for minecart tracks?
Does Doodling or Improvising on the Piano Have Any Benefits?
How do I tell my boss that I'm quitting in 15 days (a colleague left this week)
What does "tick" mean in this sentence?
Check if object is null and return null
Why is the Sun approximated as a black body at ~ 5800 K?
Is there anyway, I can have two passwords for my wi-fi
Limit max CPU usage SQL SERVER with WSRM
What is the smallest number n> 5 so that 5 ^ n ends with "3125"?
Isometric embedding of a genus g surface
Why do Radio Buttons not fill the entire outer circle?
Can I cause damage to electrical appliances by unplugging them when they are turned on?
How do I Interface a PS/2 Keyboard without Modern Techniques?
Typing CO_2 easily
Why does the Persian emissary display a string of crowned skulls?
What should be the ideal length of sentences in a blog post for ease of reading?
Did I make a mistake by ccing email to boss to others?
Why is the principal energy of an electron lower for excited electrons in a higher energy state?
How to calculate floating point numbers?
How to calculate a floating point of negative number?Data Representation QuestionFloating Point CalculationHow are floating-point numbers logarithmically distributed?Floating point representation in 8 bitWhat is the second smallest C single precision positive floating number there is? (IEEE754)Floating point representationHow many bits to represent these numbers precisely?Floating Point Numbers - Machine numbersAdding two IEEE754 floating-point representations and interpreting the result.
$begingroup$
Here are two locations in memory:
0110 | 1111 1110 1101 0011
0111 | 0000 0110 1101 1001
Interpret locations 6 (
0110
) and 7 (0111
) as an IEEE floating point number.
Location 6 contains bits [15:0] and location 7 contains bits [16:31].
Floating Point -
Locations 6 and 7: 0000 0110 1101 1001 1111 1110 1101 0011
The number represented is 1.101 1001 1111 1110 1101 0011 × 2^(-114)
Is my answer correct?
I am unsure exactly what the [16:31] and [15:0] relate to/mean?
floating-point
$endgroup$
add a comment |
$begingroup$
Here are two locations in memory:
0110 | 1111 1110 1101 0011
0111 | 0000 0110 1101 1001
Interpret locations 6 (
0110
) and 7 (0111
) as an IEEE floating point number.
Location 6 contains bits [15:0] and location 7 contains bits [16:31].
Floating Point -
Locations 6 and 7: 0000 0110 1101 1001 1111 1110 1101 0011
The number represented is 1.101 1001 1111 1110 1101 0011 × 2^(-114)
Is my answer correct?
I am unsure exactly what the [16:31] and [15:0] relate to/mean?
floating-point
$endgroup$
$begingroup$
Not really a math question. You may have better luck on a computing site.
$endgroup$
– Gerry Myerson
Sep 14 '14 at 7:25
$begingroup$
@GerryMyerson Can't we migrate this for him? It's been done for at least one my questions and maybe one of yours.
$endgroup$
– Robert Soupe
Sep 14 '14 at 17:12
$begingroup$
@Robert, I suppose we could vote to close and migrate, or flag for moderator attention and suggest migration, but I don't know enough about computing sites to suggest one as the target.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 1:32
$begingroup$
@Gerry, I was looking at programmers.stackexchange, but a question there about converting from single precision float to half precision was closed for being "off-topic" (which of course does not always mean it really is off-topic. The scope is said to include questions about "algorithm and data structure concepts."
$endgroup$
– Robert Soupe
Sep 15 '14 at 2:34
$begingroup$
@Robert, if you find an appropriate site, go ahead and take whatever steps you can to migrate. I'm happy to let OP do the work of finding a better site and the work of contacting the moderators to migrate, or let OP delete here and post elsewhere.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 3:53
add a comment |
$begingroup$
Here are two locations in memory:
0110 | 1111 1110 1101 0011
0111 | 0000 0110 1101 1001
Interpret locations 6 (
0110
) and 7 (0111
) as an IEEE floating point number.
Location 6 contains bits [15:0] and location 7 contains bits [16:31].
Floating Point -
Locations 6 and 7: 0000 0110 1101 1001 1111 1110 1101 0011
The number represented is 1.101 1001 1111 1110 1101 0011 × 2^(-114)
Is my answer correct?
I am unsure exactly what the [16:31] and [15:0] relate to/mean?
floating-point
$endgroup$
Here are two locations in memory:
0110 | 1111 1110 1101 0011
0111 | 0000 0110 1101 1001
Interpret locations 6 (
0110
) and 7 (0111
) as an IEEE floating point number.
Location 6 contains bits [15:0] and location 7 contains bits [16:31].
Floating Point -
Locations 6 and 7: 0000 0110 1101 1001 1111 1110 1101 0011
The number represented is 1.101 1001 1111 1110 1101 0011 × 2^(-114)
Is my answer correct?
I am unsure exactly what the [16:31] and [15:0] relate to/mean?
floating-point
floating-point
edited Mar 14 at 7:13
Winfield Chen
484
484
asked Sep 14 '14 at 6:03
Patrick StevensPatrick Stevens
61113
61113
$begingroup$
Not really a math question. You may have better luck on a computing site.
$endgroup$
– Gerry Myerson
Sep 14 '14 at 7:25
$begingroup$
@GerryMyerson Can't we migrate this for him? It's been done for at least one my questions and maybe one of yours.
$endgroup$
– Robert Soupe
Sep 14 '14 at 17:12
$begingroup$
@Robert, I suppose we could vote to close and migrate, or flag for moderator attention and suggest migration, but I don't know enough about computing sites to suggest one as the target.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 1:32
$begingroup$
@Gerry, I was looking at programmers.stackexchange, but a question there about converting from single precision float to half precision was closed for being "off-topic" (which of course does not always mean it really is off-topic. The scope is said to include questions about "algorithm and data structure concepts."
$endgroup$
– Robert Soupe
Sep 15 '14 at 2:34
$begingroup$
@Robert, if you find an appropriate site, go ahead and take whatever steps you can to migrate. I'm happy to let OP do the work of finding a better site and the work of contacting the moderators to migrate, or let OP delete here and post elsewhere.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 3:53
add a comment |
$begingroup$
Not really a math question. You may have better luck on a computing site.
$endgroup$
– Gerry Myerson
Sep 14 '14 at 7:25
$begingroup$
@GerryMyerson Can't we migrate this for him? It's been done for at least one my questions and maybe one of yours.
$endgroup$
– Robert Soupe
Sep 14 '14 at 17:12
$begingroup$
@Robert, I suppose we could vote to close and migrate, or flag for moderator attention and suggest migration, but I don't know enough about computing sites to suggest one as the target.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 1:32
$begingroup$
@Gerry, I was looking at programmers.stackexchange, but a question there about converting from single precision float to half precision was closed for being "off-topic" (which of course does not always mean it really is off-topic. The scope is said to include questions about "algorithm and data structure concepts."
$endgroup$
– Robert Soupe
Sep 15 '14 at 2:34
$begingroup$
@Robert, if you find an appropriate site, go ahead and take whatever steps you can to migrate. I'm happy to let OP do the work of finding a better site and the work of contacting the moderators to migrate, or let OP delete here and post elsewhere.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 3:53
$begingroup$
Not really a math question. You may have better luck on a computing site.
$endgroup$
– Gerry Myerson
Sep 14 '14 at 7:25
$begingroup$
Not really a math question. You may have better luck on a computing site.
$endgroup$
– Gerry Myerson
Sep 14 '14 at 7:25
$begingroup$
@GerryMyerson Can't we migrate this for him? It's been done for at least one my questions and maybe one of yours.
$endgroup$
– Robert Soupe
Sep 14 '14 at 17:12
$begingroup$
@GerryMyerson Can't we migrate this for him? It's been done for at least one my questions and maybe one of yours.
$endgroup$
– Robert Soupe
Sep 14 '14 at 17:12
$begingroup$
@Robert, I suppose we could vote to close and migrate, or flag for moderator attention and suggest migration, but I don't know enough about computing sites to suggest one as the target.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 1:32
$begingroup$
@Robert, I suppose we could vote to close and migrate, or flag for moderator attention and suggest migration, but I don't know enough about computing sites to suggest one as the target.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 1:32
$begingroup$
@Gerry, I was looking at programmers.stackexchange, but a question there about converting from single precision float to half precision was closed for being "off-topic" (which of course does not always mean it really is off-topic. The scope is said to include questions about "algorithm and data structure concepts."
$endgroup$
– Robert Soupe
Sep 15 '14 at 2:34
$begingroup$
@Gerry, I was looking at programmers.stackexchange, but a question there about converting from single precision float to half precision was closed for being "off-topic" (which of course does not always mean it really is off-topic. The scope is said to include questions about "algorithm and data structure concepts."
$endgroup$
– Robert Soupe
Sep 15 '14 at 2:34
$begingroup$
@Robert, if you find an appropriate site, go ahead and take whatever steps you can to migrate. I'm happy to let OP do the work of finding a better site and the work of contacting the moderators to migrate, or let OP delete here and post elsewhere.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 3:53
$begingroup$
@Robert, if you find an appropriate site, go ahead and take whatever steps you can to migrate. I'm happy to let OP do the work of finding a better site and the work of contacting the moderators to migrate, or let OP delete here and post elsewhere.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 3:53
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
The [16:31]
and [15:0]
refer to locations in the binary representation of a $32$-bit integer. You have interpreted this correctly.
When in doubt about technical problems, always consult Wikipedia an expert.
In your case the number is0
|| 00001101
|| 101 1001 1111 1110 1101 0011
The sign is positive.
The biased exponent is 1101
$ = 13$, so the actual exponent is $13 - 127 = -114$, assuming single precision.
So the answer you have is correct:
$$2^-114 times (1.101 1001 1111 1110 1101 0011)_2$$
$endgroup$
1
$begingroup$
If this question didn't advocate trusting Wikipedia at any level on any topic, and if I was the issuer of the bounty, I think I would award it to this answer.
$endgroup$
– Robert Soupe
Sep 17 '14 at 0:49
$begingroup$
I'd let the typo slide, though ("techincal").
$endgroup$
– Robert Soupe
Sep 17 '14 at 1:35
$begingroup$
Hows that? Better?
$endgroup$
– A.E
Sep 17 '14 at 2:38
3
$begingroup$
Endianness do matter. You can check here
$endgroup$
– user137035
Sep 17 '14 at 10:22
$begingroup$
Agreed, endianness matters. I am assuming that the bits in memory correspond to a 32 bit word (in the order stated) and that the exponent and mantissa have the MSB on the left.
$endgroup$
– A.E
Sep 17 '14 at 18:24
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f930566%2fhow-to-calculate-floating-point-numbers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
The [16:31]
and [15:0]
refer to locations in the binary representation of a $32$-bit integer. You have interpreted this correctly.
When in doubt about technical problems, always consult Wikipedia an expert.
In your case the number is0
|| 00001101
|| 101 1001 1111 1110 1101 0011
The sign is positive.
The biased exponent is 1101
$ = 13$, so the actual exponent is $13 - 127 = -114$, assuming single precision.
So the answer you have is correct:
$$2^-114 times (1.101 1001 1111 1110 1101 0011)_2$$
$endgroup$
1
$begingroup$
If this question didn't advocate trusting Wikipedia at any level on any topic, and if I was the issuer of the bounty, I think I would award it to this answer.
$endgroup$
– Robert Soupe
Sep 17 '14 at 0:49
$begingroup$
I'd let the typo slide, though ("techincal").
$endgroup$
– Robert Soupe
Sep 17 '14 at 1:35
$begingroup$
Hows that? Better?
$endgroup$
– A.E
Sep 17 '14 at 2:38
3
$begingroup$
Endianness do matter. You can check here
$endgroup$
– user137035
Sep 17 '14 at 10:22
$begingroup$
Agreed, endianness matters. I am assuming that the bits in memory correspond to a 32 bit word (in the order stated) and that the exponent and mantissa have the MSB on the left.
$endgroup$
– A.E
Sep 17 '14 at 18:24
add a comment |
$begingroup$
The [16:31]
and [15:0]
refer to locations in the binary representation of a $32$-bit integer. You have interpreted this correctly.
When in doubt about technical problems, always consult Wikipedia an expert.
In your case the number is0
|| 00001101
|| 101 1001 1111 1110 1101 0011
The sign is positive.
The biased exponent is 1101
$ = 13$, so the actual exponent is $13 - 127 = -114$, assuming single precision.
So the answer you have is correct:
$$2^-114 times (1.101 1001 1111 1110 1101 0011)_2$$
$endgroup$
1
$begingroup$
If this question didn't advocate trusting Wikipedia at any level on any topic, and if I was the issuer of the bounty, I think I would award it to this answer.
$endgroup$
– Robert Soupe
Sep 17 '14 at 0:49
$begingroup$
I'd let the typo slide, though ("techincal").
$endgroup$
– Robert Soupe
Sep 17 '14 at 1:35
$begingroup$
Hows that? Better?
$endgroup$
– A.E
Sep 17 '14 at 2:38
3
$begingroup$
Endianness do matter. You can check here
$endgroup$
– user137035
Sep 17 '14 at 10:22
$begingroup$
Agreed, endianness matters. I am assuming that the bits in memory correspond to a 32 bit word (in the order stated) and that the exponent and mantissa have the MSB on the left.
$endgroup$
– A.E
Sep 17 '14 at 18:24
add a comment |
$begingroup$
The [16:31]
and [15:0]
refer to locations in the binary representation of a $32$-bit integer. You have interpreted this correctly.
When in doubt about technical problems, always consult Wikipedia an expert.
In your case the number is0
|| 00001101
|| 101 1001 1111 1110 1101 0011
The sign is positive.
The biased exponent is 1101
$ = 13$, so the actual exponent is $13 - 127 = -114$, assuming single precision.
So the answer you have is correct:
$$2^-114 times (1.101 1001 1111 1110 1101 0011)_2$$
$endgroup$
The [16:31]
and [15:0]
refer to locations in the binary representation of a $32$-bit integer. You have interpreted this correctly.
When in doubt about technical problems, always consult Wikipedia an expert.
In your case the number is0
|| 00001101
|| 101 1001 1111 1110 1101 0011
The sign is positive.
The biased exponent is 1101
$ = 13$, so the actual exponent is $13 - 127 = -114$, assuming single precision.
So the answer you have is correct:
$$2^-114 times (1.101 1001 1111 1110 1101 0011)_2$$
edited Sep 17 '14 at 18:17
answered Sep 16 '14 at 21:29
A.EA.E
1,7101722
1,7101722
1
$begingroup$
If this question didn't advocate trusting Wikipedia at any level on any topic, and if I was the issuer of the bounty, I think I would award it to this answer.
$endgroup$
– Robert Soupe
Sep 17 '14 at 0:49
$begingroup$
I'd let the typo slide, though ("techincal").
$endgroup$
– Robert Soupe
Sep 17 '14 at 1:35
$begingroup$
Hows that? Better?
$endgroup$
– A.E
Sep 17 '14 at 2:38
3
$begingroup$
Endianness do matter. You can check here
$endgroup$
– user137035
Sep 17 '14 at 10:22
$begingroup$
Agreed, endianness matters. I am assuming that the bits in memory correspond to a 32 bit word (in the order stated) and that the exponent and mantissa have the MSB on the left.
$endgroup$
– A.E
Sep 17 '14 at 18:24
add a comment |
1
$begingroup$
If this question didn't advocate trusting Wikipedia at any level on any topic, and if I was the issuer of the bounty, I think I would award it to this answer.
$endgroup$
– Robert Soupe
Sep 17 '14 at 0:49
$begingroup$
I'd let the typo slide, though ("techincal").
$endgroup$
– Robert Soupe
Sep 17 '14 at 1:35
$begingroup$
Hows that? Better?
$endgroup$
– A.E
Sep 17 '14 at 2:38
3
$begingroup$
Endianness do matter. You can check here
$endgroup$
– user137035
Sep 17 '14 at 10:22
$begingroup$
Agreed, endianness matters. I am assuming that the bits in memory correspond to a 32 bit word (in the order stated) and that the exponent and mantissa have the MSB on the left.
$endgroup$
– A.E
Sep 17 '14 at 18:24
1
1
$begingroup$
If this question didn't advocate trusting Wikipedia at any level on any topic, and if I was the issuer of the bounty, I think I would award it to this answer.
$endgroup$
– Robert Soupe
Sep 17 '14 at 0:49
$begingroup$
If this question didn't advocate trusting Wikipedia at any level on any topic, and if I was the issuer of the bounty, I think I would award it to this answer.
$endgroup$
– Robert Soupe
Sep 17 '14 at 0:49
$begingroup$
I'd let the typo slide, though ("techincal").
$endgroup$
– Robert Soupe
Sep 17 '14 at 1:35
$begingroup$
I'd let the typo slide, though ("techincal").
$endgroup$
– Robert Soupe
Sep 17 '14 at 1:35
$begingroup$
Hows that? Better?
$endgroup$
– A.E
Sep 17 '14 at 2:38
$begingroup$
Hows that? Better?
$endgroup$
– A.E
Sep 17 '14 at 2:38
3
3
$begingroup$
Endianness do matter. You can check here
$endgroup$
– user137035
Sep 17 '14 at 10:22
$begingroup$
Endianness do matter. You can check here
$endgroup$
– user137035
Sep 17 '14 at 10:22
$begingroup$
Agreed, endianness matters. I am assuming that the bits in memory correspond to a 32 bit word (in the order stated) and that the exponent and mantissa have the MSB on the left.
$endgroup$
– A.E
Sep 17 '14 at 18:24
$begingroup$
Agreed, endianness matters. I am assuming that the bits in memory correspond to a 32 bit word (in the order stated) and that the exponent and mantissa have the MSB on the left.
$endgroup$
– A.E
Sep 17 '14 at 18:24
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f930566%2fhow-to-calculate-floating-point-numbers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Not really a math question. You may have better luck on a computing site.
$endgroup$
– Gerry Myerson
Sep 14 '14 at 7:25
$begingroup$
@GerryMyerson Can't we migrate this for him? It's been done for at least one my questions and maybe one of yours.
$endgroup$
– Robert Soupe
Sep 14 '14 at 17:12
$begingroup$
@Robert, I suppose we could vote to close and migrate, or flag for moderator attention and suggest migration, but I don't know enough about computing sites to suggest one as the target.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 1:32
$begingroup$
@Gerry, I was looking at programmers.stackexchange, but a question there about converting from single precision float to half precision was closed for being "off-topic" (which of course does not always mean it really is off-topic. The scope is said to include questions about "algorithm and data structure concepts."
$endgroup$
– Robert Soupe
Sep 15 '14 at 2:34
$begingroup$
@Robert, if you find an appropriate site, go ahead and take whatever steps you can to migrate. I'm happy to let OP do the work of finding a better site and the work of contacting the moderators to migrate, or let OP delete here and post elsewhere.
$endgroup$
– Gerry Myerson
Sep 15 '14 at 3:53