Questions tagged as 'float'

2
answers

PHP value rounding error

I have a problem, after assigning a variable a float value as below, 4.85, after multiplying by 100, 48500 and when I will print out the value of 00000000484. $variavel = 4.85; $valor = $variavel * 100; echo sprintf("%011d",$valor);     
asked by 30.06.2014 / 14:02
5
answers

How to fix the number of numeric characters of a float?

I wrote a simple code where at the end of a mathematical operation I need the result to come out with seven numeric characters regardless of where the dot is. Unfortunately I can only adjust the precision of the decimal places but I need somethi...
asked by 12.06.2017 / 23:45
2
answers

I can not get floats return by expressions

When I try to give print(6/10) I get a int (0) instead of a float (0.6) And if I give type(6/10) it returns int . I'm following this tutorial and doing exactly the same steps both in pyCharm and in IDLE,...
asked by 27.02.2015 / 08:31
1
answer

Problems with inserting data in float field in MYSQL

I have a problem inserting a value into a field in the table, this field is as float (15,6). I circled an insert here INSERT INTO valores (valor) VALUES ('1160.480000'); Why does he enter the value as 1160.479980?     
asked by 11.01.2017 / 15:06
1
answer

Parsing columns of numbers from a CSV file in C

Hello, Good Night I have a simple .CSV file, containing only two columns, separated by a comma and the new line, as an example: 0.001,-9.623 0.098,2.540 1.000,-1.002 And you need to separate them preferably in two vectors, or in an array...
asked by 19.03.2018 / 02:23
3
answers

Arrange divs in blocks one over the other?

I'd like to organize my divs in column form, but not side by side, but rather one over the other. Normally when using float: left or display: inline-block the elements are placed side by side up to the size limit, and then a new li...
asked by 19.07.2018 / 00:48
2
answers

In PHP, is there a difference between Double and Float?

In some programming languages, Float and Double, although similar, are not the same thing. But apparently in PHP there is no difference between these two types. Is there any special reason for this? Why does Cast Double and Float result in th...
asked by 05.08.2017 / 19:28
2
answers

Turn string into number

I have a problem that for many is simple, I have a code that takes the value of a input of type hidden and when I get this value, I add +1, that is, if the value is 3 it add +1 and has to stay 4: var total = $("#total").attr('val...
asked by 06.03.2015 / 19:35
1
answer

Turn all elements of a list into floats

This is the code I wrote. n_alunos=input('') x=0 idades=[] alturas=[] while x != n_alunos: x+=1 n=raw_input('') a=n.split(" ") idades.append(a[0]) alturas.append(a[1]) How do I transform the elements of the 2 string lis...
asked by 19.11.2017 / 23:27
1
answer

Different numbers become equal after conversion with doubleval [closed]

I have 2 values 4850.00 and 4850.01 When I define 2 variables manually with these values and compare using if , it returns me different (OK). But in an ERP system I develop I get 2 values via AJAX. Both the same values above and even...
asked by 07.08.2015 / 20:01