计算小数到精确值(Devide by) [英] Calculate decimal to exact value (Devide by)

查看:131
本文介绍了计算小数到精确值(Devide by)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按价值将十进制值打印除以

例如

0.5进1/2

1.5进1 1 / 2

2.5成2 1/2

任何值.....



帮助我

I want to Print The Decimal Value Into Divide by Value
For Example
0.5 into 1/2
1.5 into 1 1/2
2.5 into 2 1/2
any value.....

Help Me

推荐答案

这是一种肮脏的方式,但它有效:



http://www.dreamincode.net/forums/topic/287922-converting-decimals-to-standard-fractions/ [ ^ ]







http://www.c-sharpcorner.com/forums/thread/29984/converting-decimals-to-fractions.aspx [ ^ ]



P / s:我们不做你的功课,google it urself并尝试理解它。
this is a dirty way, but it works :

http://www.dreamincode.net/forums/topic/287922-converting-decimals-to-standard-fractions/[^]

or

http://www.c-sharpcorner.com/forums/thread/29984/converting-decimals-to-fractions.aspx[^]

P/s: we dont do your homework, google it urself and try to understand it.


我们不做你的作业:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是就像你想象的那样困难!



但这不是一项特别困难的任务,如果你谷歌的十进制分数算法,你会发现许多方法。那么你要做的就是决定哪一个并实现一个!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

But this isn't a particularly difficult task, and if you google for decimal to fraction algorithm you will find a number of methods. All you have to do then is decide which and implement one!


这篇关于计算小数到精确值(Devide by)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆