Math.Sin出了点问题 [英] Something wrong with Math.Sin

查看:121
本文介绍了Math.Sin出了点问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎没有为Math.Sin定义合约。但是,以下内容在编译时成功验证(这是错误的)但在运行时抛出ContractException(这是正确的):

Contract.Assert(Math.Sin(Math.PI / 2)< 0.5 )

解决方案

您好Alexey,我无法重现它,所以我认为应该已经修复了。

谢谢,<登记/>˚F

Seems like there is no contracts defined for Math.Sin. However the following is successfully validated at compile time (which is wrong) but throws ContractException at runtime (which is right):

Contract.Assert(Math.Sin(Math.PI/2) < 0.5)

解决方案

Hi Alexey,
  I cannot reproduce it, so I think should have been fixed already.

Thanks,
f


这篇关于Math.Sin出了点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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