# Questions tagged as 'float'

4

## Mathematical division needs

On the Windows calculator: 9 / 3,0001 = 2,999 ... In my program: 9 / 3,0001 = 3; I would like to get this level of precision using C. See excerpts from my program: double op(double num1, double num2, char c) { if(c == '/')...
3

## Get value Integer in end .00 and float value in .01 to 0.9

I have this code below that is from a calculator, however I have a problem: I wanted to return a float value when dividing 5/2 = 2.5 and returning an integer value when dividing 4/2 = 2 and not 2.0 ! Can anyone help me with this? The c...
3

## Doubt with float

#include<stdio.h> int main ( void ){ float y = 12.0809; printf("The number %.2f is a float\n"); return 0; } I know that %.2f is used to consider only two decimal places, but I'd like to know what an integer serves before the peri...
1

## Problem with float vector

I created a code for a college exercise that was running right, but I forgot that one of the variables of struct was a vector, and when I made a simple change everything changed. Virtually all functions are giving error. I do not find the...
1

## Problem with float python (uri 1098)

I'm trying to solve this problem and when I run the code, at some point it stops working correctly . I think it's because of rounding, but when that part is removed, the code executes to infinity. i = 0 j = 1 while(i != 2.2): print('I=%...
1

## Float to string conversion - how to display two or more decimal places?

I have the following code, which returns values of type float . How can I make the result appear with two or more decimal places? private void btnDividirActionPerformed(java.awt.event.ActionEvent evt) {...
4

## Mathematical division needs

On the Windows calculator: 9 / 3,0001 = 2,999 ... In my program: 9 / 3,0001 = 3; I would like to get this level of precision using C. See excerpts from my program: double op(double num1, double num2, char c) { if(c == '/')...
1

## Fields aligned in form

Good evening, I used 'float: right;' to put some fields in a side-by-side form, but they go down one field. 'Full Name' and 'Date of Birth' should be side by side, but the date field descends. Picture: Codes:Registrationpage link CSS li...
1