Is there a way to find the integer representation of a real number?

In summary, the conversation discusses finding the integer of a real number using an algebraic formula without the use of functions. Various suggestions are made, such as using IF statements or starting with arctan(tan(x)) and shifting it. The definition of "algebraic" is also questioned.
  • #1
hatem240600
7
3
Is there a way to find the integer of a real number? Of course without using the [x] function. What I am looking for here is an algebraic formula.
 
Mathematics news on Phys.org
  • #2
You want an algorithm for a function without allowing the use of functions, right ?

How about IF statements ? Range of your function ?

(by the way, in many computer languages a = b does tthe trick if a is an integer and b a real :smile: )
 
Last edited by a moderator:
  • Like
Likes jedishrfu
  • #3
You can get pretty close by starting with arctan(tan(x)). This gives you a sawtooth which you can shift, scale and subtract from f(x)=x. It's just those pesky points where tan x is undefined that get you.

Will you allow arctan2 as part of an algebraic formula?
 
  • #4
To get answers that you want, you will note that the posters so far have asked how you define algebraic. These answers are reasonable. Please provide a solid definition. We cannot leave the thread open, if you continue to have the people who are helping you forced to guess. Thanks.
 
  • Like
Likes YoungPhysicist, jedishrfu and BvU
  • #5
Since the OP has come back to the site and ignored the request for question improvement, this thread is closed. Thanks to the two posters who gave it a good try.
 
  • Like
Likes YoungPhysicist, BvU and berkeman

1. Can a real number be represented as an integer?

Yes, a real number can be represented as an integer if the number is a whole number without any decimal or fractional parts.

2. How can I convert a real number to its integer representation?

To convert a real number to its integer representation, you can use the floor or ceiling function depending on whether you want to round down or up to the nearest integer.

3. Is the integer representation of a real number always accurate?

No, the integer representation of a real number may not always be accurate as it involves rounding. This can lead to a loss of precision in the number.

4. Can all real numbers be represented as integers?

No, not all real numbers can be represented as integers. Some real numbers, such as irrational numbers like pi or square root of 2, have infinite decimal places and cannot be represented as a finite integer.

5. Are there any limitations to finding the integer representation of a real number?

Yes, there are limitations to finding the integer representation of a real number, such as the loss of precision mentioned earlier and the fact that some real numbers cannot be represented as integers. Additionally, the size of the integer may also be limited by the computer's memory capacity.

Similar threads

Replies
23
Views
1K
Replies
9
Views
1K
Replies
1
Views
692
Replies
13
Views
1K
Replies
1
Views
932
  • General Math
Replies
1
Views
1K
Replies
1
Views
749
Replies
6
Views
1K
Replies
1
Views
715
Replies
4
Views
253
Back
Top