Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Nearest number' topicStudent Support Forum > General > Archives > "Nearest number"

Next Comment >Help | Reply To Topic
Author Comment/Response
Ralph10
01/17/12 09:39am

Dear Mathematica group,
I have a simple question for you.
Let's say there is an array or matrix like

AA = {1, 2, 3, 4, 5.1, 5.3};
BB = {1, 2, 3, 4, 5, 5.1, 5.3};

I want to find the nearest number to 5 but less or equal than 5.

In this case, the answer should be:
for AA list: 4
for BB list: 5

Can I do it with Nearest function?
Thanks!

URL: ,

Subject (listing for 'Nearest number')
Author Date Posted
Nearest number Ralph10 01/17/12 09:39am
Re: Nearest number Nasser M. Ab... 01/17/12 4:10pm
Re: Nearest number Bill 01/17/12 6:50pm
Next Comment >Help | Reply To Topic