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这样一个浮点数,-到另一个浮点数-,然后为我们处理除法。
Last thing to say is why would you want to have exceptions? Well, let's go back to that case of inputting a simple little floating point.
最后要讲的是为什么有异常处理?,回到输入一个简单的小浮点数的例子,如果我期望主要是。
Then next week we'll do more complicated problems that involve motion in higher dimensions, how to go to two dimensions or three dimensions.
下周我们将会处理更复杂的问题,包括更高维数的物体运动,如何处理二维以及三维运动
It takes an int; deal with it when you get to it and then once you look through the whole file, should you find -- ultimately find the actual code that defines or impliments this thing.
它携带一个int数,当你获得了它就处理它,然后一旦你查看整个文件,最终你将发现实际代码中,定义或执行了这个东西。
All right. What does this have to do with my divisor example? This says I can make tuples, but imagine now going back to my divisor example and I want to gather up the elements as I go along. I ought to be able to do that by in fact just adding the pieces in.
这意味着我可以创建元组了,但是想像下回到我们的除数的例子,在处理过程中我们想把目标数的除数,收集起来,我应该能够通过把这些数,一个一个加进来来实现这个目的,我正是要去这么做,也就是。
Do what you normally do with ordinary numbers.
就按照通常处理数的运算的方法去做
And it will just do this ad nauseam until I actually give it an int or if I realize, "Wow, I really screwed up this program.
它将会令人作呕地反复如此处理,直到我给它一个int数或者当我认识到:“喔,我真的弄砸了这个程序。
Ah ha, it goes into that accept portion, prints out a message, and goes back around the while loop to say try again. And it's going to keep doing this until I give it something that does serve as a float.
他会说输入一个浮点数,啊哈,它就到了那段处理代码,打印出消息,然后回到while循环让我们再输一次,它会持续这么做直到它接受到一个浮点数。
应用推荐