" Index"。即,该变量将是您想要迭代的数组的索引。 i的使用由FORTRAN语言颁布,允许 只有单字母变量名称(并且也是大写的,所以它实际上是我的b $ b)。 FOR语句通常用于遍历 数组,而I和J是用于目的的常用索引变量。 - \如果你写了''猴子'这个词一百万次,你会开始| ` \认为你莎士比亚? - Steven Wright | _o__)| Ben Finney< http://bignose.squidly.org/>"Index". i.e., the variable will be the index of an array you want toiterate over.The usage of "i" was promulgated by the FORTRAN language, which allowedonly single-letter variable names (and was all upper case, too, so itwas actually I). The FOR statement was commonly used to iterate over anarray, and I and J were the commonly used index variables for thatpurpose.--\ "If you write the word ''monkey'' a million times, do you start |`\ to think you''re Shakespeare?" -- Steven Wright |_o__) |Ben Finney <http://bignose.squidly.org/> 它'是随意的,但是一些程序员使用i。在迭代中要么是代表迭代或索引。 - Aq2It''s arbitrary, but some programmers use "i" in an iteration to eitherstand for iteration or index.--Aq2 索引。即,变量将是您想要迭代的数组的索引。 i的使用。由FORTRAN语言颁布,允许只有单字母变量名称(并且也是大写的,所以它实际上是我)。 FOR语句通常用于遍历数组,而I和J是该目的常用的索引变量。 "Index". i.e., the variable will be the index of an array you want to iterate over. The usage of "i" was promulgated by the FORTRAN language, which allowed only single-letter variable names (and was all upper case, too, so it was actually I). The FOR statement was commonly used to iterate over an array, and I and J were the commonly used index variables for that purpose. 关闭,但不完全。 早期版本的Fortran支持最多6个字符的变量名。 实际上,Fortran总是允许更长的变量名,但是只有第一个 6才有意义。我相信它是6个字符的原因是 ,字符长度为36位,字符集中有64个字符(因为你说b $ b b,不是小写),你可以准确地将一个6个字符的字符串打包成1个 机器字。 每个人使用I然后J作为for循环索引的实际原因 是Fortran,默认情况下,假设所有以IN字母开头的变量是来自IN的整数,所有其他变量名都是真的。整数 以I开头的名字大概是根据其助记符值选择的, 其他字母依次按顺序排列,大概足够了什么 原始语言设计师认为是合理的20:6分割真实到 整数变量。 显然你会选择一些非常有意义的东西:^) 6个字符名称 表示所有重要的线性回归库函数,但对于一个简单的循环,为什么要这么麻烦。Close, but not quite there.Early versions of Fortran supported variable names up to 6 characters long.Actually, Fortran always allowed longer variable names, but only the first6 were significant. I believe the reason why it was 6 characters was thatwith a 36bit word length and 64 characters in your character set (as yousay, no lower case), you could exactly pack a 6 character string into 1machine word.The actual reason why everyone uses I and then J as the for loop indexeswas that Fortran, by default, assumed all variables starting with lettersfrom I-N were integer, and all other variable names were real. Integernames starting with I was presumably chosen for its mnemonic value and theother letters then follow on in sequence, presumably far enough for whatthe original language designers thought was a reasonable 20:6 split real tointeger variables.Obviously you are going to pick some really meaningful :^) 6 character namefor that all important linear-regression library function but for a simpleloop, why bother. 这篇关于为什么我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-05 07:01