2 Topics

Member Avatar for
Member Avatar for ddanbe

Hi all, I need to obtain the fractional part of a double. AFAIK C# and .NET has no such function. Have a few options here:(x is a double) `x - (int)x` `x - Math.Truncate(x)` Convert to a string and extract the fraction... Perhaps someone knows other options? Which should I …

Member Avatar for JOSheaIV
0
638
Member Avatar for EarhawkPH

I'm having problems with this program. Everytime i enter a fractional decimal number, it displays -0.0000 or sometimes garbage values. Ex: Enter any fractional decimal number: 5.7 -2.888blah blah blah garbage another Ex: Enter any fractional decimal number: 25.7 -0.000000 #include<stdio.h> int main(){ long double fraDecimal,fraBinary,bFractional = 0.0,dFractional,fraFactor=0.1; long int …

Member Avatar for David W
0
385

The End.