Solver Convert Decimal to Fraction
Algebra
->
Algebra
->
Numeric Fractions Calculators, Lesson and Practice
-> Solver Convert Decimal to Fraction
Log On
Ad:
Algebrator™
solves your algebra problems and provides step-by-step explanations!
Ad:
Algebra Solved!™
: algebra software solves algebra homework problems with step-by-step help!
Algebra: Numeric Fractions
Solvers
Lessons
Problems, free tutors
Quiz
In Depth
Source code of 'Convert Decimal to Fraction'
This Solver (Convert Decimal to Fraction)
was created by by
ichudov(404)
:
View Source
,
Show
,
Put on YOUR site
About ichudov
:
I am not a paid tutor, I am the owner of this web site.
==section input Convert DECIMAL number *[input x=2.34] to a fraction. ==section solution perl print "Convert $x into fraction. "; my ($int, $frac) = split( /\./, $x ); print "The integer part of $x is $int, the fractional part is 0.$frac.\n\n"; $num = $frac; $denom = $frac; $denom =~ s/\d/0/g; $denom = "1$denom"; print "We have {{{$x = $int" . chr( 38 ) . "$num/$denom}}}.\n\nWe can reduce {{{$num/$denom}}} to"; my $f = reduce_fraction( $num, $denom ); my $answer = "{{{$int" . chr( 38 ) . "$f}}}"; print "$answer (see the Numeric Fractions section).\n\n\nAnswer: $x=$answer"; $num = $f; $num =~ s/\/.*$//; ==section output num ==section check x=2.34 num=17 denom=50