• So what that means is the compiler is actually going to first "cast" so to speak 13 from whatever it is - to a float -- to a floating point value -- and then perform the division for us.

    所以这里的意思是编译器将,做“计算“,譬如13这样一个浮点数,-到另一个浮点数-,然后为我们处理除法。

    哈佛公开课 - 计算机科学课程节选

  • But if I say turn this into a float, ah it throws a value error exception.

    它就会抛出一个值错误异常了,它会告诉我输入了一种错误的值。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • > David: At some point in time, I'm going to have to have declared the variable as a float before I can then hand it to printf as the insertion value for that format strength.

    >,大卫:在一个特定的时间,我将需要,声明float类型这样的变量,那样我就可以把它打印出来,像是格式化优点的插入值。

    哈佛公开课 - 计算机科学课程节选

  • Need to get the base in. Second thing I want to do, I need to get the height, so I'm going to input a value for the height, also as a float, a floating point.

    也就是输入底的值,第二件我想要做的,事情就是得到三角形的高,因此我会输入一个值作为三角形的高,同样也是一个浮点数。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So if I were to solve this problem, here's the way I would do it. I would say, first thing I want to do, is I want to input a value for the base as a float.

    如果我想要解决这个问题,这就是我要解决它的方式了,第一件我要做的事情就是要,输入一个浮点数作为三角形的底。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Now, this is not the nicest way to do it but it'll work. I can look at the type of the value of base and compare it to the type of an actual float and see, are they the same?

    这不是最好的办法但它确实有用,我可以得到底的值的类型然后,和一个真的浮点数的类型比比,看他们是不是一样?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • - Then you declare a float called f and then assign it -- -- let me scroll up for the folks in front -- that give return value of GetFloat.

    然后你声明一个float类型f,再赋值-,让我向上为你们回滚到-,给出了GetFloat的返回值。

    哈佛公开课 - 计算机科学课程节选

  • float So thus far, when we've defined -- declared an int and a float, 2 and so forth, we just put one value in there, the number 2, the number 3.14, just one single value.

    至此,当我们定义--声明一个int,和一个,等等,我们只要在那里放置一个值,数字,数字3,14,只有一个值。

    哈佛公开课 - 计算机科学课程节选

  • Now, a float is floating point value.

    由于,float就是一个浮点数值。

    哈佛公开课 - 计算机科学课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定