c语言pow立方根,C#math.pow立方根计算(C# math.pow cube root calculation)

有三个担心,我有。

你在你的表达式中的一部分利用Math.Pow(),但是,你会想在谈话过程中,后来给出的表达式的第一部分使用Math.Sqrt()。

其次,与表达中的括号分组导致表达的错误评价的问题

第三,你将需要你没有一个十进制值,以评估预期的结果数值后使用“d”字符后缀。

以下方程:(0.3D *((0.0015d *(0.793700526d + Math.Sqrt(0.7071068)))+(0.015d * Math.Pow((0.05D 0.05D *),(1D / 3D)))))

编码:

using System;

namespace POW

{

class Program

{

static void Main(string[] args)

{

// Corrected calculation derived from comment conversation given by author

double myCalculation1 = (0.3 * ((0.0015 * (0.793700526 + Math.Sqrt(0.7071068))) + (0.015 * Math.Pow((0.05 * 0.05), (1 / 3)))));

// d suffix used to ensure the non decimal value is treated as a decimal

double myCalculation2 = (0.3 * ((0.0015 * (0.793700526 + Math.Sqrt(0.7071068))) + (0.015 * Math.Pow((0.05 * 0.05), (1d/3d)))));

// Output the value of myPow

Console.WriteLine("The value of myCalculation is: {0}", myCalculation1);

Console.WriteLine("The value of myCalculation is: {0}", myCalculation2);

}

}

}

重要的是,按照惯例,你会希望每个号码后使用“d”后缀。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值