获取双精度列表中的值的索引 [英] Get index of a value in a list of doubles

查看:95
本文介绍了获取双精度列表中的值的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从双打列表中获取某个值的索引?

如何在双精度列表中获取最大值的索引?

How do you get the index of a certain value from a list of doubles?
Also how would get the index of the maximum value in a list of doubles?

推荐答案

如果您使用的是 List< double> IndexOf [ ^ ]和最大 [ ^ ]。

(最大值是一种扩展方法,可从.Net 3.5获得可以从.Net 2.0获得IndexOf。



问候,

Ian。
If you are using a List<double> how about IndexOf[^] and Max[^].
(Max is an extension method, available from .Net 3.5 onwards. IndexOf is available from .Net 2.0).

Regards,
Ian.


这篇关于获取双精度列表中的值的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆