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

  • #1
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.
 

Answers and Replies

  • #2
BvU
Science Advisor
Homework Helper
14,097
3,521
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
jbriggs444
Science Advisor
Homework Helper
9,570
4,234
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
jim mcnamara
Mentor
4,223
2,787
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
jim mcnamara
Mentor
4,223
2,787
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

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

Replies
4
Views
2K
Replies
16
Views
1K
  • Last Post
Replies
2
Views
1K
Replies
6
Views
2K
Replies
42
Views
2K
Replies
2
Views
2K
  • Last Post
Replies
5
Views
1K
Replies
7
Views
1K
Top