can someone explain wtf Floating Point Numbers are?
Floating Point Numbers Reply Hide Jarvis Wonkinwill - Tue, 31 Jul 2018 18:41:40 EST JrM6mJRf No.37608 File: 1533076900708.jpg -(6453B / 6.30KB, 188x250) Thumbnail displayed, click image for full size. can someone explain wtf Floating Point Numbers are? >> Fuck Blytheham - Wed, 01 Aug 2018 05:09:32 EST cIyjo+iF No.37609 Reply It's a fraction and an exponent and usually a sign. It's kind of like scientific notation with the goal of sacrificing precision so you can load and operate on the numbers efficiently in hardware. FP is used pretty much everywhere except finance where the lack of precision will get you sued. >> Jenny Dartdock - Thu, 02 Aug 2018 01:58:27 EST Xm/W+3lL No.37610 Reply >>37609Well...kinda.The IEEE754 floating-point standard that pretty much everyone uses was created with the goal of being able to re-use many per-existing hardware pieces, and you'll find that some of the integer hardware still works on it (equality, sign bits, zero, and addition, subtraction, less-than, and greater-than are all mostly compatible), however new hardware was required for it (such as hardware that handles floating point exceptions, denormal numbers, infinities and NaNs).However, as it turns out different pieces of hardware handle floating point numbers differently. GPUs, for instance, get to follow most of the rules of the spec while ignoring some other rules that allow them to accelerate their hardware greatly while still remaining mostly compatible:https://docs.microsoft.com/en-us/windows/desktop/direct3d10/d3d10-graphics-programming-guide-resources-float-rules >> Rebecca Socklefoot - Sat, 04 Aug 2018 00:05:05 EST x6K3CZQk No.37616 Reply Watch the floating point lecturehttps://www.cs.cmu.edu/~213/schedule.html >> Jenny Fuckingcocke - Thu, 01 Nov 2018 03:05:45 EST E/AtBUMC No.37667 Reply A floating point number is of course bits in memory.The first bit is the sign bit. 0 means the number is negative, 1 means the number is positive. Note that this is the opposite from how negative integers are usually represented in binary (two's complement).Next after the sign comes the exponent. it's either 8 or 11 bits long depending on if the floating point is a float or a double (32 or 64 bits in total).This exponent is biased, which means there is an implicit value that is subtracted from the unsigned binary integer value the exponent has. For 32 bit floats the bias is IIRC -127, so an exponent of 00000001 (binary) is -126, 10000000 binary is 1 etc. the exponent shouldn't have an exponent value of all 0s or 1s, those are for denoting special cases such as NaN, infinities and other stuff.The last part is the significand. This is somewhat like your normal integer value: Each bit on the left means double the value of the bit on the right. The difference is that the leftmost bit means value 0.5, the next is 0.25 etc.Also an implicit 1 is added (another bias if you will). Knowing some math you know that the significand value is always between 1 (included) and 2 (excluded).Finally the value of the floating point number is(-1)^sign * 2^exponent * significand.The sign part is just mathematical notation "if sign is 1, then negative, otherwise positive". Remember the biases in exponent and significand.So a0 10000010 11010000000000000000000 would besign: positiveexponent: 128+2 -127 = 3significand: 0.5 + 0.25 + 0.0625 = 0.8125and the final value: 2^3 * 0.8125 = 6.5
>> Fuck Blytheham - Wed, 01 Aug 2018 05:09:32 EST cIyjo+iF No.37609 Reply It's a fraction and an exponent and usually a sign. It's kind of like scientific notation with the goal of sacrificing precision so you can load and operate on the numbers efficiently in hardware. FP is used pretty much everywhere except finance where the lack of precision will get you sued.
>> Jenny Dartdock - Thu, 02 Aug 2018 01:58:27 EST Xm/W+3lL No.37610 Reply >>37609Well...kinda.The IEEE754 floating-point standard that pretty much everyone uses was created with the goal of being able to re-use many per-existing hardware pieces, and you'll find that some of the integer hardware still works on it (equality, sign bits, zero, and addition, subtraction, less-than, and greater-than are all mostly compatible), however new hardware was required for it (such as hardware that handles floating point exceptions, denormal numbers, infinities and NaNs).However, as it turns out different pieces of hardware handle floating point numbers differently. GPUs, for instance, get to follow most of the rules of the spec while ignoring some other rules that allow them to accelerate their hardware greatly while still remaining mostly compatible:https://docs.microsoft.com/en-us/windows/desktop/direct3d10/d3d10-graphics-programming-guide-resources-float-rules
>> Rebecca Socklefoot - Sat, 04 Aug 2018 00:05:05 EST x6K3CZQk No.37616 Reply Watch the floating point lecturehttps://www.cs.cmu.edu/~213/schedule.html
>> Jenny Fuckingcocke - Thu, 01 Nov 2018 03:05:45 EST E/AtBUMC No.37667 Reply A floating point number is of course bits in memory.The first bit is the sign bit. 0 means the number is negative, 1 means the number is positive. Note that this is the opposite from how negative integers are usually represented in binary (two's complement).Next after the sign comes the exponent. it's either 8 or 11 bits long depending on if the floating point is a float or a double (32 or 64 bits in total).This exponent is biased, which means there is an implicit value that is subtracted from the unsigned binary integer value the exponent has. For 32 bit floats the bias is IIRC -127, so an exponent of 00000001 (binary) is -126, 10000000 binary is 1 etc. the exponent shouldn't have an exponent value of all 0s or 1s, those are for denoting special cases such as NaN, infinities and other stuff.The last part is the significand. This is somewhat like your normal integer value: Each bit on the left means double the value of the bit on the right. The difference is that the leftmost bit means value 0.5, the next is 0.25 etc.Also an implicit 1 is added (another bias if you will). Knowing some math you know that the significand value is always between 1 (included) and 2 (excluded).Finally the value of the floating point number is(-1)^sign * 2^exponent * significand.The sign part is just mathematical notation "if sign is 1, then negative, otherwise positive". Remember the biases in exponent and significand.So a0 10000010 11010000000000000000000 would besign: positiveexponent: 128+2 -127 = 3significand: 0.5 + 0.25 + 0.0625 = 0.8125and the final value: 2^3 * 0.8125 = 6.5