Locate a number in an array

前端 未结 0 457
悲&欢浪女
悲&欢浪女 2020-12-14 18:09

I have an array of rational numbers, say A=[1.5 2.8 3.5 4.8 5.9 6.5 7.6 8.3 9.1 10.7]

How do I find that a given number, say B=5.6 is closer to 5.9(in the array A.

相关标签:
回答
  • 消灭零回复
提交回复
热议问题