A
A
Avery0072014-04-24 10:51:55
JavaScript
Avery007, 2014-04-24 10:51:55

How do you know if a number is irrational?

It is necessary to determine whether the number is irrational or not.
How can I do that?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
I
Ilya, 2014-04-24
@Avery007

Pfft, I don't understand what to talk about here:
1. We take an expression like 2/3.
2. We perform division.
3. Enter into a variable.
4. We do an elementary check * of the number in the variable - is it infinite or not. If the variable has an infinite number, then it is irrational.
* Of course, this is only possible if you don't want to know how the computer represents numbers.

A
Alexander Petrov, 2014-04-24
@dzhiriki

An irrational number can be represented as an infinite non-repeating decimal.

In a computer, ALL numbers are finite. No matter how big the size of the number we set, it will be finite. This means that all numbers in the computer are rational. Yes, they can be approximated with some accuracy to some irrational number, but no more.

V
vans239, 2014-04-24
@vans239

Despite the complete inadequacy of the question, you can still try to check this if the number is obtained through some formula. You can calculate the result of this formula with different accuracy (but they must be large) and if the results are different, then the number has more digits in its record than indicated. Then this number can be considered irrational. This approach probably has a lot of bugs, but in simple cases it should work
. In Java, this could be done using BigInteger.

K
Konstantin Kitmanov, 2014-04-24
@k12th

Do you even have the slightest idea how computers represent numbers?

A
Andrey Vershinin, 2014-04-24
@WolfdalE

All numbers that a computer operates on are rational. You can, of course, use abstract concepts, like the root of 5, but that's different.

K
killla, 2014-04-24
@killla

How is the number entered?

1
1001001 111, 2014-04-24
@IgorO2

This is the number that cannot be represented as a fraction ...
Have you even tried to google?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question