coda slider 2.0具有%宽度以响应(coda slider 2.0 to have % widths for responsive)
我已经使用了Nail Doherty的coda滑块几年了,并且想知道是否有人知道如何使其响应,以便它使用容器的%宽度而不是px。 我知道在css中需要一个固定的宽度来计算面板的js中的宽度,以使滑块正确工作/显示,但是想知道是否有修复使其变为液体。
我可以使用媒体屏幕查询来重新调整某些屏幕分辨率的大小,但如果可能的话,我会在流畅的答案之后。
I have used Nail Doherty's coda slider for a few years now and was wondering if anyone knew of a way to make it responsive so that it uses % widths for the container not px. I understand that it needs a fixed width in the css to calculate the widths in the js for the panels to make the slider work/display correctly but wondered if there was a fix to make it liquid.
I can use media screen queries for it to re-size at certain screen resolutions but was after a liquid answer if possible.
原文:https://stackoverflow.com/questions/11029925
最满意答案
浮点数中的尾数通常用大于或等于1但小于2的数字表示。在所有示例中,它恰好等于1,但最后一个。
那么,你最后一个怎么办? 将0.857421875重新表示为0.857421875 * 2/2,即1.71484375 * 2 -1 。 现在,你想要十六进制的尾数。 Double在尾数中具有53位(包括隐含的1),因此在这些52(53)位中的1.71484375实际上表示为等于1.71484375 * 2 52 = 7722969673498624 = 0x1B700000000000的整数。 所以,你有它,0x1.b7p-1。
The mantissa in the floating point number is typically represented with a number bigger or equal than 1 but smaller than 2. It's exactly equal to 1 in all examples but the last one.
So, what do you do with the last one? Rerepresent 0.857421875 as 0.857421875 * 2/2, that is, as 1.71484375*2-1. Now, you want the mantissa in hex. Double has 53 bits in the mantissa (including the implied 1.), so 1.71484375 in those 52(53) bits is effectively represented as an integer equal to 1.71484375*252 = 7722969673498624 = 0x1B700000000000. So, there you have it, 0x1.b7p-1.
相关问答
更多-
Java浮点数的表示形式为十六进制数字(Java floating-point numbers representation as a hexadecimal numbers)[2022-03-25]
0x1e3和0x1e3d是十六进制整数文字。 请注意,在这种情况下, e和d是十六进制数字,而不是指数指示符或double类型指示符。 1e3d是一个十进制浮点数字。 e是指数指标, d表示这是double而非float 。 符号0x1p3是以十六进制表示浮点文字的一种方式,正如您可以在Java语言规范的第3.10.2节中阅读的那样。 这意味着1次2的权力3; 指数是二元的(所以,它是2个电量而不是10个电量)。 0x1e3 and 0x1e3d are hexadecimal integer litera ... -
C中的十六进制浮动常数(hexadecimal floating constant in C)[2024-03-13]
0x0.3p10是C99中引入的十六进制浮点文字的示例。 p将基数与指数分开。 0x0.3位称为有效部分(整数为可选分数),指数为两倍的幂。 该特定值以十六进制为0.3 ,或3 * 16 -1 ( 3/16 )乘以2 10 × 2 10 ( 1024 )计算,得到3 * 1024 / 16或192 。 以下程序确认: #includeint main (void) { double d = 0x0.3p10; printf ("%.f\n", d); retur ... -
让我重新开始第三次。 我们试图加速 q = x / y 其中y是整数常数, q , x和y都是IEEE 754-2008 binary32浮点值。 下面, fmaf(a,b,c)表示使用binary32值的融合乘法加a * b + c 。 天真的算法是通过预先计算的倒数, C = 1.0f / y 所以在运行时一个(快得多)乘法就足够了: q = x * C Brisebarre-Muller-Raina加速度使用两个预先计算的常数, zh = 1.0f / y ...
-
根据语法 : DecimalFloatingPointLiteral: Digits . [Digits] [ExponentPart] [FloatTypeSuffix] . Digits [ExponentPart] [FloatTypeSuffix] Digits ExponentPart [FloatTypeSuffix] Digits [ExponentPart] FloatTypeSuffix HexadecimalFloatingPointLiteral: HexS ...
-
以十六进制形式浮点(Floating point in hexadecimal form)[2023-05-09]
0x1. p± >>> (1.2).hex() '0x1.3333333333333p+0' >>> (1125.2).hex() '0x1.194cccccccccdp+10' >>> (7e85).hex() '0x1.204362b6da56fp+285' >>> (5e-3).hex() '0x1.47ae147ae147bp-8' >>> (-8.).hex() '-0x1.0000000000000p+3' >>> (60123.124).he ... -
float_of_string应该能够解析它们: # float_of_string "0x1.199999999999Ap1";; - : float = 2.2 然而,正如Alain Frisch在OCaml的bug跟踪器中指出的那样 ,支持实际上取决于底层的libc,并且目前不会在MSVC端口上工作。 float_of_string should be able to parse them: # float_of_string "0x1.199999999999Ap1";; - : float = ...
-
十六进制浮点常数(Hexadecimal Floating-Point Constant)[2023-02-15]
浮点数中的尾数通常用大于或等于1但小于2的数字表示。在所有示例中,它恰好等于1,但最后一个。 那么,你最后一个怎么办? 将0.857421875重新表示为0.857421875 * 2/2,即1.71484375 * 2 -1 。 现在,你想要十六进制的尾数。 Double在尾数中具有53位(包括隐含的1),因此在这些52(53)位中的1.71484375实际上表示为等于1.71484375 * 2 52 = 7722969673498624 = 0x1B700000000000的整数。 所以,你有它,0x ... -
C中的浮点数(Floating-point numbers in C)[2020-02-01]
您可以使用仅使用整数的这段代码 : printf(n==1?"1.00000":"0.%05d ", 100000/n); You can use this piece of code that uses only integers: printf(n==1?"1.00000":"0.%05d ", 100000/n); -
当前的计算机具有32位或64位寄存器,因此对字节进行计算效率非常低。 此外,计算机以二进制方式工作,因此使用2的幂的基础更有效。 像Mysticial说的那样,他们会使用2 32或2 64 。 每个计算机字将存储数字的数字,并且它们逐位工作。 在某些情况下,您不需要太多计算,但大多数情况下您输入并输出十进制字符。 使用功率或10的基础的这种情况更有效。 您可以在32位计算机中使用base 10 9 ,在64位计算机中使用10 19 ,因为这是您可以存储在32或64位值中的最大功率10 Current com ...
-
默认情况下,Fortran的REAL数字常量是单精度的 ; 但是,在C中,浮点文字具有双精度。 当您将0.8804418转换为单精度然后在C中将其打印为double精度时,您将获得0.8804417849打印( 演示 ) float x = 0.8804418f; printf("%.10g\n", x); Fortran的打印输出似乎是四舍五入的相同数字。 Fortran的双精度REAL数字语法使用后缀d : print *, 0.8804418d+0 这打印0.88044180000000005 ( ...