## What is the difference between a fraction and a float?

I understand any fraction to be a quotient of integers which isn’t 0, but after coming across the term "float" in various programming languages (such as JavaScript) I misunderstand why it is even needed and we don’t say a fraction instead.

What is the difference between a fraction and a float?

## Is the Saltwater Float represented in this question a good way to test for loaded dice?

Recently a question has popped up in the comments of another question I’ve recently answered where a player has happened to roll three 18s and other high stats at a table with his dice, which could lead me to believe that he may be playing with a set of loaded or imbalanced dice.

Is the method presented in the youtube video How to check the balance of your d20 an accurate representation of a die’s weighting and balance and could it be used to properly and reliably test whether dice are loaded?

The video provides the following instructions for testing whether or not a die is balanced or not:

Ingredients:
1/4 cup of hot tap water (our water is a little hard)
6 tablespoons of Epsom salt

1. Put the water in a small jam jar.
2. Dump 2 tablespoons of Epsom salt into the water; put the lid on it and shake it till it dissolves.
3. Dump 2 more tablespoons of Epsom salt into the water; put the lid on it and shake it till it dissolves.
4. Add the last 2 tablespoons of Epsom salt; microwave the water on high for 30 seconds.
5. Put the lid on it and shake it till it dissolves (use a dish towel to hold this, it is hot at this point).
6. Once dissolved, set the closed container in a cold water bath until it cools back down to a little cooler than the room temperature.

## Does an Ooze (Gelatinous Cube) float?

If I have a situation where an ooze, such as a Gelatinous Cube, is near a source of water, like a small pond or underground stream, is there source material somewhere that says whether the ooze floats or sinks? Is there any mention of their density — so whether they could travel over the body of water, possibly try to resist being carried away by it, or if they sink to the bottom?

## SharePoint List Formatting; Float Left, 31 Items, Displays 10

When using this sample: https://github.com/SharePoint/sp-dev-list-formatting/blob/master/view-samples/document-library-thumbnails/document-library-thumbnails.json

All items should display as formatted and have paging. However, when the list has 31 items, using the formatting from the sample, the number of items displayed will always be no more than 10, no paging available. All works as expected when the list has 30 or fewer items. If the list has 31 or more, only 10 items will be displayed. I can remove one item, refresh, and then all works as expected. Add one more item, refresh, and the view will only show 10. Setting the root element style > float:none, save, refresh, will show all items again. Switching back to style > float:left will trigger the 10 item limit.

Has anyone else encountered this? Here is my JSON for the custom list formatting:

`` {   "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",   "hideSelection": true,   "hideColumnHeader": true,   "rowFormatter": {     "elmType": "a",     "attributes": {       "class": "ms-borderColor-neutralLight",       "href": "[\$  p002ToolsUrl]"     },     "style": {       "float": "left"     },     "children": [       {         "elmType": "div",         "attributes": {           "class": "ms-bgColor-themeLighterAlt ms-bgColor-themePrimary--hover ms-fontColor-white--hover"         },         "style": {           "display": "flex",           "flex-wrap": "wrap",           "flex-direction": "column",           "align-items": "stretch",           "padding": "1px",           "margin": "10px",           "max-width": "930px",           "box-shadow": "2px 2px 4px darkgrey"         },         "children": [           {             "elmType": "img",             "attributes": {               "src": "[\$  p002ToolsImg]"             },             "style": {               "width": "auto",               "height": "300px"             },             "children": [               {                 "elmType": "span",                 "txtContent": "[\$  Title]",                 "style": {                   "margin-bottom": "1px"                 },                 "attributes": {                   "class": "ms-fontSize-m ms-fontWeight-regular ms-fontColor-neutralSecondary"                 }               }             ]           }         ]       }     ]   } } ``

## How to center the website and and float list inside left sidebar to the right

Hi guys,

I did not code for three years and html isn't my thing and when I come back it's kind of I have to start over. So bear with me if I ask stupid questions or too much.

What I'm trying to achieve is to center the whole web site and move the list on the left sidebar to the right side. The result is as ugly as the attached image.

Here's what I'm attempting so far:

`` <!doctype html> <html><head>     <title>mysite</title>       <meta charset="utf-8" />     <link rel="canonical"...``
Code (markup):

How to center the website and and float list inside left sidebar to the right

## Smallest integer i stored as a float such that i+1=i

So I had an assignment which asked me to find the smallest integer $$i$$ which when represented as a float is such that $$i+1=i$$

My approach- By making a simple C++ program , we get $$i=16777216$$ or $$i=2^{24}$$ But if we want to do that theoretically, I am unable to arrive at this number.

So a float is 32 bit variable and the first bit represents sign of mantissa and the next 23 bits represent the number in Mantissa. The next bit represents sign of the exponent and the following 7 bits represent the value of exponent.

Now consider $$2^{23}$$. In Binary, it is represented as $$1000,0000,0000,0000,0000,0000$$ (the comma’s are just to make things readable). Now if we add $$1$$ to it, it becomes $$1000,0000,0000,0000,0000,0001$$

Now we store these numbers as float in C++. Both the numbers $$2^{23}$$ and $$2^{23}+1$$ are stored as $$0100,0000,0000,0000,0000,0000,00010111$$ (the 1 in the end has to be scrapped in order to fit the number in 24 bits). So both of them are essentially the same for the computer.

But why does the computer give me answer as $$2^{24}$$?

The code that I used

``#include<iostream>  using namespace std;  int main(){      float i=1;     while(1<2)     {         if(i+1==i)             {cout << fixed << i << endl;                 break;}         i=i+1;     }   } ``

## Why multiplying float number by multiple of 10 seems to preserve better precision?

It is famous that for float numbers:

``.1 + .2 != .3 ``

but

``1+2=3 ``

It seems that multiplying floats by 10 allows you to preserve more precision. To further illustrate the case, we can do this in python:

``sum([3000000000.001]*300) #900000000000.2957  sum([3000000000.001 * 1000]*300) / 1000 #900000000000.3 ``

By multiplying each element in the list by 1000 and divide the sum of the list by 1000, I can get the “correct” answer. I am wondering: 1) why it’s the case. 2) Will this always work, and 3) At what magnitude, will this method backfire, if it will.

## Can i run Qt application on ARMHF(hard float architecture), which is compiled on ARMEL(Soft float architecture)?

I have compiled one Qt application using ARMEL (Soft float architecture) and while i am running application on other arm device which is configured with ARMHF (Hard float architecture). Will it work ????

## What is a good way to derive a float from a hash?

Say I have a SHA-512 hash of some data.
How could I get a float from the hash? (With JavaScript)
The only solution I’ve found so far is to extract all the numbers in the hash and convert that to a float. (Prone to last digits being cropped out)

``Number("0." + sha256("data").replace(/([a-z])/g, ``)); ``

This is probably insecure, so what is a better way of extracting a float from a hash? (`Better` meaning that there is a uniform distribution of numbers)

## Transformar “5,5” String a Float “5.5”

Estoy trabajando con `pytesseract` y debe reconocer una imagen la cual tiene un número decimal pero separado por “,” en vez de “.”.

¿Existe alguna forma de reemplazar la coma en el `string` por un punto para luego poder convertirlo en un float sin ningún problema?