And if it is going to be a standing wave then this must be an integral number of wavelengths.
如果这有个驻波的话,那么周长就是个整数。
int So, primitive type besides those three types, we have ints which are just integers which are similarly 32 bits.
除了这三种类型外,还有一种最原始的数据类型,32比特整数。
Come on, you know, representing sets of integers, this is pretty dumb. Suppose I want to have a set of characters. How could I do that?
你知道的,表示整数的集合,这好傻啊,假设我有一组字母的集合?
Give me a whole number for the Fed fund's rate ? and the nearest thousand for the Dow Jones. Ken?
美联储基金利率说整数,道琼斯指数精确到千位,肯?
That is important, that elements, because they are the building blocks, they combine in whole number multiples.
这很主要,元素,因为它们在组成区块,它们化合成整数倍。
Again, same kind of reasoning says, given some value x, I happened to pick a small one here, what's an easy way to do this? Well, let's just start at one. That's my variable I'm going to change and check.
好,尤其是,让我们到这里来,让我给大家看看第二个例子,让我把这个注释掉,这是我要解决的,第二个问题,假设我想找到一些整数的,所有除数,我想要找出来这个数的所有的除数。
I have constant time access which is great, but I paid a price, which is I had to use up some space.
我的访问时间现在是常数级别,这个非常的棒,但是我也付出了代价,不得不使用更多的空间,在整数的例子中。
So, a couple of weeks ago we proposed to swap two integers, and we couldn't at the time.
那么,几周前,我们提出交换两个整数,然而在那时,我们办不到。
Suppose I want to find all the divisors of some integer, I want to figure out what all the divisors are that go evenly into it.
也就是遍历所有的整数来寻找,一个数的平方根,让我们再来看一个例子吧,为了找出另外一种的解决方法。
So at the end of the day we're not gonna get out of this need to compare, at least in this context of cups that have weights or ints that have values.
最终我们也无法改变要进行比较的需要,至少在有重量的杯子或者,整数的情况下是这样的。
So at the very top, I've coded up the same thing as before: "Give me an integer between one and ten," or rather, -- "give me an integer between one and ten" -- a little different this time.
所以在顶部,我像之前那样对同样的东西进行编码:,“给我一个1到10的整数“,或者,“给我一个1到10的整数“,这次有点不同。
The reason I want to point this out to you is, if we go back up to the kinds of data objects we started with, floats, ints, strings, they actually behave the same way.
我要为大家指出这一点的原因是,如果我们想一下以前讲过的,数据类型的种类,浮点数,整数,字符串,它们实际上有相同的行为方式。
OK. And I'm going to look to see, is a particular element inside of that list, and again, I'll remind you, that's just giving me the integers from zero up to 9999 something or other.
一个又大又长的列表吧,好的,我打算查找列表中的一个特定元素,我会告诉你,我用的是0到大概是,9999左右的整数。
Again as I suggested if I've got two integers and I want to find common divisors I could take those two lists and walk through them.
我还要说如果我们有了两个整数,并且想求两者的公因数的话我,可以把这两个整数的。
These are the basic blocks so, therefore, whole number ratios is a consequence of that.
这些是基本区块,所以,整数比是那的结果。
And that makes sense because this is not going to be a whole number, right?
这样才有意义,因为这个结果将不会是,一个整数,对吗?
Atoms of different elements combine in simple whole number ratios to form compounds.
不同元素的原子,以简单的整数比化合成化合物。
Well the idea of a hash, in fact, what's called a hash function is to have some way of mapping any kind of data into integers.
我要怎么做?实际上想法还是哈希,通过一个哈希函数,把任何种类的数据都映射成整数。
0 >> David: Yeah, so I very deliberately changed this 9 to a 9.0 so that my math would actually be floating point math involving real numbers and not just integers.
>,大卫:是的,我故意地把9改成9,那样我的数学实际上就是浮点数的了,包括实数,不只是整数。
Could be ints, could be floats, could be a combination of things, some ints, some floats, some lists, some strings, some lists of lists, whatever.
但是我们知道数组内部的元素,可以是任何对象,可能是整数也可能是浮点数,也可能是对象的组合,一些整数。
I give it some character. It gives me back an integer representing. It looks weird.
我输入一些字符,程序返回给我一个整数的表示。
Bohr said that the angular momentum, mvr where n is this integer counter h over 2 pi.
波尔提及到角动量,是被量化了的,mvr,is,quantized,这里的n等于一个整数乘以h除以2π
I print out -- and this is only wrapping - because of the big font -- I print out, "I demand that you give me a positive integer."
我打印出来--这个字符相互覆盖了,因为用的是大字体-,我打印:“我需要你给我一个正整数“
Otherwise, this is going to be doing something strange, but all integers?
否则,程序会去做一些,奇怪的事情,但是是所有的整数么?
I'm going to write a function to compute integer power exponents.
我要去写一个,计算一个整数幂指数的方法。
So with an integer, an int data type, you can store any number between 0 and 4 billion roughly.
只要有一个整数,一个int型的数据,就能储存任意一个,位于0到40亿之间的一个数。
Right, It's just squaring an integer, is what it's doing.
对了,这个程序就是,用来求一个整数的平方的。
Probably should be integers, right?
可能应该是整数吧,对不对?
I demand that you give me a positive integer.
我要求你给我一个正整数。
It's doing integer division.
这是整数的除法。
应用推荐