Slide 1

Slide 1 text

Tomoki Ota ʲGoݴޠʳrange

Slide 2

Slide 2 text

Goʹ͸ɺdo΍while͸ͳ͘ for͔͠ଘࡏ͠ͳ͍ɻ

Slide 3

Slide 3 text

rangeͱ͸ʁ ஋ͷίϐʔ rangeͷධՁ rangeʹ͓͚ΔϙΠϯλ ΞδΣϯμ 3

Slide 4

Slide 4 text

rangeͱ͸ʁ

Slide 5

Slide 5 text

rangeͱ͸ʁ 5 ༷ʑͳσʔλߏ଄ʹରͯ͠ɺ൓෮ॲཧΛߦ ͏ͷʹศརͳํ๏ ΠϯσοΫε΍ऴྃঢ়ଶΛѻ͏ඞཁ͕ͳ͍

Slide 6

Slide 6 text

rangeͱ͸ʁ 6 range͕͍͔ʹͯ͠஋ΛׂΓ౰ͯΔ͔Λ஌͍ͬͯͳ͍ͱ όάΛى͜͢ݪҼͱͳΓ͔Ͷͳ͍ʂ

Slide 7

Slide 7 text

จࣈྻ ഑ྻ ഑ྻ΁ͷϙΠϯλ εϥΠε Ϛοϓ ड৴νϟωϧ rangeͰ࢖͑Δσʔλߏ଄

Slide 8

Slide 8 text

rangeͷ࢖͍ํ

Slide 9

Slide 9 text

rangeͷ࢖͍ํ

Slide 10

Slide 10 text

rangeͷ࢖͍ํ

Slide 11

Slide 11 text

for _ := range s {} ͸ίϯύΠϧΤϥʔ = Λ࢖͓͏ʂ rangeͷ࢖͍ํ

Slide 12

Slide 12 text

஋ͷίϐʔ

Slide 13

Slide 13 text

஋ͷίϐʔ 13 [{1100} {1200} {1300}]ʹ͸ͳΒͳ͍ʂ

Slide 14

Slide 14 text

GOͰ͸୅ೖ͞ΕΔ΋ͷ͸ શͯίϐʔͰ͋Δ

Slide 15

Slide 15 text

஋ͷίϐʔ 15 ߏ଄ମΛฦؔ͢਺ͷ݁ՌΛ୅ೖ͢Δͱɺͦͷߏ଄ମͷίϐʔ͕ߦΘΕΔ ϙΠϯλΛฦؔ͢਺ͷ݁ՌΛ୅ೖ͢ΔͱɺϝϞϦΞυϨεͷίϐʔ͕ߦΘΕΔ (64bitΞʔΩςΫνϟͰ͸ΞυϨε͸64bit௕ͱͳΔɻ)

Slide 16

Slide 16 text

஋ͷίϐʔ 16 εϥΠεͷΠϯσοΫεΛ༻͍ͯཁૉʹΞΫηε͢Δ ैདྷͷfor range ϙΠϯλΛ࢖༻͢Δ

Slide 17

Slide 17 text

εϥΠεͷΠϯσοΫεΛ༻͍ͯཁૉʹΞΫηε͢Δ ैདྷͷfor 17

Slide 18

Slide 18 text

εϥΠεͷΠϯσοΫεΛ༻͍ͯཁૉʹΞΫηε͢Δ range 18

Slide 19

Slide 19 text

ϙΠϯλΛ࢖༻͢Δ 19

Slide 20

Slide 20 text

ϙΠϯλΛ࢖༻͢Δ 20 εϥΠεܕΛมߋ͢Δඞཁ͕͋Δ͕ɺৗʹՄೳͱ͸ݶΒͳ͍ ੑೳΛॏࢹ͢Δ৔߹ɺϙΠϯλͷεϥΠεΛ൓෮ॲཧ͢Δ͜ͱ͸༧ଌՄೳੑʹ͔͚ΔͨΊ CPUʹͱͬͯޮ཰͕ѱ͘ͳΔՄೳੑ͕͋Δ

Slide 21

Slide 21 text

rangeͷධՁ

Slide 22

Slide 22 text

rangeͷධՁ 22 range͸͕ࣜඞਢ

Slide 23

Slide 23 text

23 for i, v := range exp rangeͷධՁ

Slide 24

Slide 24 text

24 rangeͷධՁ

Slide 25

Slide 25 text

25 rangeͷධՁ

Slide 26

Slide 26 text

26 rangeͷධՁ rangeΛ࢖ͬͨ࣌ʹ༩͑ΒΕ͕ͨࣜ ։࢝લʹ1౓͚ͩධՁ͞ΕΔɻ s͸range͕࢖͏Ұ࣌ม਺ʹίϐʔ͞ΕΔɻ

Slide 27

Slide 27 text

27 rangeͷධՁ(νϟωϧ) range͸chΛධՁͯ͠ɺҰ࣌ม਺ʹίϐʔ͠ɺ ͦͷνϟωϧͷཁૉʹରͯ͠ɺ൓෮ॲཧΛߦ͏ɻ ch = ch2ʹؔΘΒͣɺrange͸ch2Ͱ͸ͳ͘ ch1ʹରͯ͠ɺ൓෮ॲཧΛଓ͚Δɻ ch = ch2͸ɺchʹ2ͭ໨ͷνϟωϧΛ୅ೖ͍ͯ͠ΔͷͰɺ ͜ͷίʔυͷޙͰclose(ch)Λݺͼग़͢ͱɺ1ͭ໨Ͱ͸ͳ͘ɺ 2ͭ໨ͷνϟωϧ͕Ϋϩʔζ͞ΕΔɻ

Slide 28

Slide 28 text

28 rangeͷධՁ(഑ྻ)

Slide 29

Slide 29 text

29 rangeͷධՁ(഑ྻ)

Slide 30

Slide 30 text

30 ࠷ޙͷཁૉͷ࣮ࡍͷ஋ͷදࣔํ๏ ΠϯσοΫεΛ࢖͏ํ๏ ഑ྻ΁ͷϙΠϯλΛ࢖͏ํ๏

Slide 31

Slide 31 text

31 ΠϯσοΫεΛ࢖༻͢Δ

Slide 32

Slide 32 text

32 ഑ྻ΁ͷϙΠϯλΛ࢖༻͢Δ

Slide 33

Slide 33 text

rangeʹ͓͚ΔϙΠϯλ

Slide 34

Slide 34 text

rangeʹ͓͚ΔϙΠϯλ 34 ΩϟογϡʹཁૉΛૠೖ͢ΔϩδοΫΛ࣮૷͍ͯ͠Δ

Slide 35

Slide 35 text

35 rangeʹ͓͚ΔϙΠϯλ

Slide 36

Slide 36 text

36 rangeʹ͓͚ΔϙΠϯλ

Slide 37

Slide 37 text

37 rangeʹ͓͚ΔϙΠϯλ

Slide 38

Slide 38 text

38 ղܾํ๏1 ϩʔΧϧม਺Λ࢖༻͢Δํ๏

Slide 39

Slide 39 text

39 ղܾํ๏2 εϥΠεͷΠϯσοΫεΛ࢖ͬͯɺ֤ཁૉΛࢀর͢ΔϙΠϯλΛ֨ೲ͢Δํ๏