0

I need a software or a command line to display the irrational number 22/7 indefinitely.

When i use calc, I'm shown a finite number of decimal places:

~$ calc 22/7
~3.14285714285714285714

How can I force my PC to calculate forever?

7
  • Do you want to know more digits of 22/7 or do you just want to computer to calculate any number?
    – Rufus_12
    Commented Jun 1, 2014 at 13:49
  • I can search google for more, but it's a homework, so I need the code or an app
    – user287384
    Commented Jun 1, 2014 at 13:50
  • Is there a limit? Do you know any programming languages?
    – Rufus_12
    Commented Jun 1, 2014 at 13:52
  • This is hard, does it never repeat? I can paste it here: 3.142857142857142793701541449991054832935333251953125 is to 51 dp, thats about as long as you can get I think, as on a 64 bit computer to do with limits of accuracy...
    – Tim
    Commented Jun 1, 2014 at 13:53
  • I dont rly know any programming languages :(
    – user287384
    Commented Jun 1, 2014 at 13:55

1 Answer 1

3
bc <<< 'scale=100;22/7'

bc is Best Calculator and is normally installed on ubuntu

scale=<num> means the number of digits you want after the comma 22/7 you calculation

found here:
https://unix.stackexchange.com/questions/40786/how-to-do-integer-float-calculations-in-bash-or-other-languages-frameworks

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .