9 Topics

Member Avatar for
Member Avatar for saurabh.mehta.33234

The following piece of code outputs 0.1000000000001 float a=0.1; printf("%lf",a); But if I add a 10 times as long float b=0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1; printf("lf",b); It outputs as 0.999999999999989 But if a=0.1 is stored as 0.1000000000001 then the answer should be greater than 10 due to the 1 in last column.Then why is …

Member Avatar for deceptikon
0
240
Member Avatar for Sam_07

I wrote a short program to factor numbers, and it works in most cases. The problem I am getting is that when I use a very large number I get "Floating point exception: 8." I am assuming that I am trying to divide by 0 on line 43 or 46, …

Member Avatar for NathanOliver
0
4K
Member Avatar for rajat.sethi93

#include<stdio.h> #include<conio.h> void main() { float a[5][5],x[3];float t,s; int i,j,k; printf("enter a matrix of order 3*4"); for(i=0;i<3;i++) { for(j=0;j<4;j++) { scanf("%f",&a[i][j]); } } for(i=0;i<3;i++) { for(j=0;j<4;j++) printf("%f ",a[i][j]); printf("\n"); } for(i=0;i<=1;i++) { for(j=i+1;j<=2;j++) { t=a[j][i]/a[i][i]; for(k=i;k<=3;k++) a[j][k]=a[j][k]-t*a[i][k]; } } printf("The upper triangular matrix is as\n"); for(i=0;i<3;i++) { for(j=0;j<4;j++) printf(" %f",a[i][j]); …

Member Avatar for rajat.sethi93
0
205
Member Avatar for cse.avinash

I am doing following code to get the output upto 5 decimal characters of any number inputted by user when divided by 1, I have to use typecast it with (float) , can any one tell me how this can be done without typecasting or using float constant.. int main() …

Member Avatar for cse.avinash
1
177
Member Avatar for Romedk

Hello dear DaniWeb members I have a problem with the new site I´m making nad I was wondering if anyone could help me. Well its because I have big content box where I´m keeping 2 news boxes in and a right box but when I put the boxes to have …

Member Avatar for gabrielcastillo
0
129
Member Avatar for kukula

Hi there, during developing website for my father's company ( [website](http://www.pgum-sill.pl/nowa_strona/index.html) ) I find out that I have problem with personalization of different lists. In this case I wanted to make a floating menu like thise one here: [Floating Menu](https://d2o0t5hpnwv4c1.cloudfront.net/018_Floating_Menu/demo/dhtml_float_menu_final_nettut.html) (this page is from this [Tutorial](http://net.tutsplus.com/tutorials/html-css-techniques/creating-a-floating-html-menu-using-jquery-and-css/)) At the pages above …

Member Avatar for fobos
0
313
Member Avatar for stevthym

Hi! I have a decimal number (e.g 6433) and would like to see the process of converting this to IEEE short real floating point format! Any help is appreciated ;)

Member Avatar for Rashakil Fol
0
1K
Member Avatar for Breakbones90

I started writing this code as practice for my Computer Science class. The goal was to help with structs and arrays. But I have come to a problem. The file will compile, but returns a message saying "floating point exception." Doing research I see there could a few reasons, but …

Member Avatar for gerard4143
0
367
Member Avatar for theUserMan

working on a 32bit architecture and i'm adding two arrays together slot by slot into a third array so if I have 3,4,4 and 4,4,4 in the arrays the third array should contain 7,8,8 at the end of the function I was able to pass in the arrays correctly and …

0
244

The End.