title: What will be the constraints of the values that can be entered in the colum that was declared as FLOAT?
body: <p>I am building a web app, and in some section in it a teacher inserts the expected results of a scientific experiment. These results must be very accurate, they might come like this <code>0.4933546522886728</code>. And after searching for a while, <code>FLOAT</code> seems to be the right datatype to store these answers in the database. As known <code>FLOAT</code> columns in mysql can be declared like this <code>FLOAT(n, d)</code>, where n is the total number of digits in the number and d is the number of digits after the decimal point. So, I do not know the number of digits the teacher will enter. So, what would happen if I declared it like this <code>FLOAT</code>. The thing that made me think of this is this <a href="https://dev.mysql.com/doc/refman/8.0/en/floating-point-types.html" rel="nofollow noreferrer">quote</a> from the mysql documentation.</p>
  
  <blockquote>
    <p>For maximum portability, code requiring storage of approximate numeric data values should use FLOAT or DOUBLE PRECISION with no specification of precision or number of digits.</p>
  </blockquote>
  
  <p>And what would be the maximum and minimum of the values to be entered in this <code>FLOAT</code> column.</p>
  
  <p>I also thought of using <code>VARCHAR</code> and store the exact number that the teacher enters and then according to the nature of the number that in the database number that the student enters to be compared with the right answer will be manipulated to match the other number.</p>
  
  <p>For example if the teacher enters <code>1.23451</code> and the student enters <code>1.4235123</code>, my code will make it <code>1.42351</code>.</p>