Questions tagged [ieee-754]

IEEE 754 is the most common & widely used floating-point standard, notably the single-precision binary32 aka float and double-precision binary64 aka double formats.

IEEE 754 is the Institute of Electrical and Electronics Engineers standard for floating-point computation, and is the most common & widely used implementation thereof.

As well as formats, IEEE754 also defines the basic operations, + - * / and sqrt, as producing correctly-rounded results (error <= 0.5ulp). Other functions like pow and sin are not required to be as accurate; that's an implementation choice between precision and performance.

This is why many CPU instruction sets only include the basic operations (including sqrt).

1447 questions
-1
votes
1 answer

Assuming three-bit exponent field and four-bit significand, what is the bit pattern for -8.75 (Based on pep/9 assembly language)

This question is based on computer system pep/9 and I need someone to explain how can I convert this -8.75 number to binary.
K.Tumba
  • 31
  • 2
-1
votes
1 answer

What is the mathematical basis of modulo fixed-point algorithm for IEEE 754 numbers

At the end of the question, an code for calculating floating modulo operation (__ieee754_fmod ) from GNU C library is presented. I'm interested in the basic ideas behind this algorithm. Of particular interest is the code marked / * fix point fmod *…
alex_noname
  • 26,459
  • 5
  • 69
  • 86
-1
votes
1 answer

inaccurate results for calculations using floats - Simple solution

Many questions have been asked on StackOverflow and elsewhere about Python's confusing behaviour with calculations which use floats - often returning a result which is clearly wrong by a small amount. The explanation for this is invariably linked…
-1
votes
1 answer

IEEE-754 floating number binary represent

I'm solving a question on online judge: https://acm.cs.nthu.edu.tw/problem/12237/ I need to represent IEEE-754 floating number with binary represent. Here's my code: #include void binaryprint(); int main(){ float x; …
王柏智
  • 1
  • 1
-1
votes
3 answers

How many different values can be encoded in IEEE 754 32-bit base-2 floating-point system?

The wikipedia page states that an IEEE 754 32-bit base-2 floating-point variable has a maximum value of (2 − 2−23) × 2127 ≈ 3.4028235 × 1038 In that number, are +∞, −∞ and NaN included? What is that 2 in "(2 − 2−23)"? Why 127 in 2127?
Joshua Leung
  • 2,219
  • 7
  • 29
  • 52
-1
votes
3 answers

How to correctly implement multiply for floating point numbers (software FP)

My program is about a method which is given floats and in this method I want to multiply or add those floats. But not multiply like a * b, I want to break those floats down to their structure like the bit for the sign, the 8 bit for the exponent and…
Chickenman
  • 1,420
  • 1
  • 7
  • 11
-1
votes
1 answer

Easiest way to convert floating point of IEEE 754 to hexadecimal

Can someone explain the step by step procedure to do the above?
-1
votes
3 answers

JAVA's Double.MIN_VALUE, IEEE 754 and Google's calculator?

It seems like the smallest non-zero number that google's calculator can calculate is 2^-1023. I.e. 2^-1024 equal 0. In JAVA Double.MIN_VALUE is 2^-1074. When reading about JAVA's Double.MIN_VALUE here and across the Internet there are many mentions…
paradox
  • 634
  • 5
  • 13
-1
votes
2 answers

Take number after floating point

I have this value : a = 1.01010101 And i need to take all the numbers after the point, convert them into an int. Create a new variable and put this int in an new variable. So i need an output like this b = 01010101 I can't make this: a -=…
Fatih Akman
  • 39
  • 1
  • 5
-1
votes
1 answer

Does a subnormal number have an implicit 0?

I'm trying to understand what a subnormal number is and I'm guessing the exponent is fixed at -127 and to make the number smaller the implicit 1 is replaced with an implicit 0. Does this sound right?
-1
votes
2 answers

Decimal to IEEE 754 Single-precision IEEE 754 code using C

We have an assignment in class to convert from Decimal to single precision using c and I'm completely lost. This is the assignment: The last part of this lab involves coding a short c algorithm. Every student must create a program that gets a…
-1
votes
1 answer

How to convert -1x10^200 to IEEE 754 double precision

So like above, I want to find the IEEE 754 representation of -1x10^200. I know we can get the sign be to be 1, as we have a negative number. However I am unsure of how to find the mantissa/exponent. My initial idea was to convert 10^200 to 2^x.…
Philip Bal
  • 23
  • 9
-1
votes
2 answers

Python 3 - decode spectroscopy data (Base64, IEEE754)

I'm a chemist and working with spectroscopic data that was stored as a list (501 pairs of X,Y data) of Base64-encoded floating point values according to IEEE754. I tried to get an array of X, Y data to work with from the raw data but failed.…
Chris
  • 13
  • 3
-1
votes
2 answers

arithmetic operations using float binary "0b"

I'm trying to understand, I'm a beginner. I want to do arithmetic operations with float numbers in binary. I was using http://www.binaryconvert.com/result_float.html to do the conversion Only he returns…
-1
votes
1 answer

Converting IEEE754 to custom floating point representation

Just looking for suggestions, how should the IEEE754 single precision floating point representation i.e. the following: -1sign ∗ 2exponent-127 ∗ 1.mantissa2 where the hidden bit worth is 1.0, be accurately and efficiently converted to a custom…
Akay
  • 1,092
  • 12
  • 32