ohp1.dvi

Similar documents
r1.dvi

untitled

活用ガイド (ハードウェア編)


ii

/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ }

Ruby Ruby ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( ) 44=>

橡6.プログラム.doc

パソコン機能ガイド

パソコン機能ガイド

はしがき・目次・事例目次・凡例.indd

Javaと.NET


2004年度日本経団連規制改革要望

II

™…

生活設計レジメ

44 4 I (1) ( ) (10 15 ) ( 17 ) ( 3 1 ) (2)

I II III 28 29


del.dvi


エクセルカバー入稿用.indd



01_.g.r..

困ったときのQ&A

01_SWGuide_V8.50.fm

困ったときのQ&A

活用ガイド (ソフトウェア編)


main.dvi

MultiPASS B-20 MultiPASS Suite 3.10使用説明書

i

ESD-巻頭言[ ].indd

訪問看護ステーションにおける安全性及び安定的なサービス提供の確保に関する調査研究事業報告書

listings-ext

I

活用ガイド (ソフトウェア編)

SC-85X2取説



<4D F736F F F696E74202D C835B B E B8CDD8AB B83685D>

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó


untitled

i


Wide Scanner TWAIN Source ユーザーズガイド

Step2 入門

Microsoft Word - 51プログラム名簿目次070913w.doc

1 1.1 (JCPRG) 30 Nuclear Reaction Data File (NRDF) PC GSYS2.4 JCPRG GSYS2.4 Java Windows, Linux, Max OS X, FreeBSD GUI PNG, GIF, JPEG X Y GSYS2

Fortran90/95 [9]! (1 ) " " 5 "Hello!"! 3. (line) Fortran Fortran 1 2 * (1 ) 132 ( ) * 2 ( Fortran ) Fortran ,6 (continuation line) 1

...J QX

1 (bit ) ( ) PC WS CPU IEEE754 standard ( 24bit) ( 53bit)


第1部 一般的コメント

<82D282A982C1746F95F18D908F57967B95B E696E6464>

秋植え花壇の楽しみ方


(Version: 2017/4/18) Intel CPU 1 Intel CPU( AMD CPU) 64bit SIMD Inline Assemler Windows Visual C++ Linux gcc 2 FPU SSE2 Intel CPU do

リファレンス

untitled


解きながら学ぶC言語

untitled

表1票4.qx4

福祉行財政と福祉計画[第3版]

第1章 国民年金における無年金

001

main.dvi

PDF Information

橡ミュラー列伝Ⅰ.PDF

64bit SSE2 SSE2 FPU Visual C++ 64bit Inline Assembler 4 FPU SSE2 4.1 FPU Control Word FPU 16bit R R R IC RC(2) PC(2) R R PM UM OM ZM DM IM R: reserved

これわかWord2010_第1部_ indd

パワポカバー入稿用.indd

これでわかるAccess2010

imageWARE Prepress Manager Select エディターガイド

新版明解C言語入門編

II III I ~ 2 ~

中堅中小企業向け秘密保持マニュアル


PR映画-1


- 2 -


1 (1) (2)

C言語によるアルゴリズムとデータ構造

グラフ数値読み取りシステム (GSYS2.4) 利用の手引

o 2o 3o 3 1. I o 3. 1o 2o 31. I 3o PDF Adobe Reader 4o 2 1o I 2o 3o 4o 5o 6o 7o 2197/ o 1o 1 1o

OFISTAR H7000ファクス編(2版 )

平成18年版 男女共同参画白書


CPU Levels in the memory hierarchy Level 1 Level 2... Increasing distance from the CPU in access time Level n Size of the memory at each level 1: 2.2


¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

学習内容と日常生活との関連性の研究-まえがき・概要・目次

アセンブラ入門(CASL II) 第3版

new_SPSS_4刷はじめから のコピー

Transcription:

2008 1 2008.10.10 1

( 2 ) ( ) ( ) 1 2 1.5 3 2

( ) 50:50 Ruby ( ) Ruby http://www.ruby-lang.org/ja/ Windows Windows 3

Web Web http://lecture.ecc.u-tokyo.ac.jp/~kuno/is08/ / ( / ) / @@@ ( 3 ) @@@ :!! ( ) @@@ 4

Web (Q&A) ( ) http://www.sodan.ecc.u-tokyo.ac.jp/cgi-bin/qbbs/view.cgi http://www.sodan.ecc.u-tokyo.ac.jp/cgi-bin/sbbs/view.cgi 5

: Ruby 6

/ 2 / 2 7

(analog quantity) (digital quantity) (analog representation) (digital representation) 8

( 1 0.1Kg ) 13.2Kg 1: 9

( ) 10

2 Kg 000.00Kg 999.99Kg 100,000 (1t ) 2 0/1 1 2 1 : 12 0 1 1 (bit) 2 1 (binary digit) 2 1 11

1 / 2 00 01 10 11 1 2 N 2 N ( ) / 12

(model) ( ) / ( )? 10cm 8cm 10 8 = 40(cm 2 ) 2 6cm 5cm 6 5 2 = 15(cm 2 ) : 13

(procedure) (data) (program) 10 8 3 4 3 6 5 4 (abstraction) 14

1 3 ( ) 10cm 8cm 15

( ) (algorithm) 5 1 2 3 6 5 6 ( ) 16

(pseudocode) (code) : 7 triarea: w h s w h 2 s 7 ( ) ( ) 17

/ : s w h 2 (assignment) (expression) 8 (variable ) w h 2 s (action) s = w h 2 h = 2s w = 8 (mathematical expression) 18

/ (main storage) (memory) (procedural computational model) (imperative language) (procedural language) 19

(programming language) (natural language ) Ruby 20

Ruby Ruby irb (irb command) 9 Ruby (method) 10 : def triarea(w, h) end s = (w * h) / 2.0 return s 9 Ruby 1 10 (subroutine) procedure ( ) 21

Ruby 1. def end 1 2. (parameter) 11 3. (statement) 12 1 ; s = (w * h) / 2.0; retu 1 4. 1 5. return (return statement) return 11 12 22

Ruby s return : def triarea(w, h) end return (w * h) / 2.0 ( ) 23

! sample1.rb Ruby.rb? Mac OS TextEdit Finder 24

! irb Ruby ( % ): % irb irb(main):001:0> irb > irb (prompt ) Ruby 25

! main ( ) (nesting ) 1 1 irb> load( ) sample1.rb (string) "" : 13 irb> load sample1.rb => true irb> true triarea load 13 Ruby irb 26

! 3 4? irb irb load load triarea : irb> triarea 8, 5 => 20.0 irb> triarea 7, 3 => 10.5 irb> irb quit : irb> quite % 1 27

! 1 irb 2 2.0 2 14 3 a. 2 ( ) b. % (reminder) c. d. x x 10 x 0.1 e. x x 15 f. 14 1 (def... end) 15 x (square root) Math.sqrt(x) 28

! e f irb puts( ) ( ) printf(" ",,, ) (format) %.Ng N x y 20 : printf("%.20g %.20g\n", x, y) 29

/ / (numerical value) (Arabic numerals 0 9 ) (positional notation) ( (Chinese numerals)( ) (Roman numerals)(i II III IV IX X XI XII ) ) 0 9 30

(decimal representation) (decimal system) 0 9 10 1 120 12 : 1 10 2 + 2 10 1 + 0 10 0 1 10 1 + 2 10 0 ( ) 10 0 = 1 10 1 = 10 2 = 100 0 9 10 (radix) 10 ( ) ( 10 ) 0 1 2 3 1 3 120 15 : 16 120 (3) = 1 3 2 + 2 3 1 + 0 3 0 = 15 (10) 16 31

(binary representation) (binary system) / / 2 / (binary numbers)/ (decimal numbers) p p (p-adic number) 0 1 2 1 2 1010 (2) 10 : 1 2 3 + 0 2 2 + 1 2 1 + 0 2 0 = 8 (10) + 2 (10) = 10 (10) 32

N 0 2 N 1 ( ) (unsigned binary representation) 1 (sign bit) (two s complement representation) ( 1) 3 2 3 0 7 4 3 7 111 6 110 5 101 4 100 3 011 011 2 010 010 1 001 001 0 000 000-1 111-2 110-3 101-4 100 2: 3 33

( ) 2 + 3 = 1 110 + 011 = (1)001 (negation 1 ) 0/1 1 3 011 0/1 100 1 101 3 101 010 011 3 2 (overflow) 34

2 0 1 ( ) (C C++ Java ) 17 Ruby Ruby Ruby 17 32 2 35

4 Ruby (time mesurement) : def bench(count, &block) end t1 = Process.times.utime count.times do yield end t2 = Process.times.utime return t2-t1 bench (1) CPU (2) (3) CPU (4)2 ( CPU ) (load ) do... end (block ) : 18 irb> bench 100000 do add(100000000, 1) end => 0.125 CPU 18 36

(integral number) (real number) 2.0 2 2.0 2 2 2 / 1 2 37

? 10 8 4 :. (fixed point) 30,000,000 0.0000001 38

3 10 8 1 10 6 1 (exponent ) (mantissa ) (floating point) 10 8 6 2 9.99999 10 99 0 0.00001 10 99 39

2 2 1 52 ( )11 64 ( IEEE754 ) (rouding ) (roundoff error) 40

2 ( ) (loss of information) ( ) 3 1.00000 2.00000 10 4 10-2 1.00000 0.000002 10 4 10 4 1.00000 10 4 3: 41

0 (cancellation) ( 0 0 ) (infinity ) (NaN Not a Number) 0 +0 0 4 10 8 10 10 8 10 8 10 8 8 10 8 10 10 8 10 4 4: 42

5 Ruby 19 6 NaN 0 Ruby 19 printf 43

1A 3 ( 1 ) kuno@mail.ecc.u-tokyo.ac.jp 1. Subject: ASCII( ) Report 1A ( ) 2. 3. 3 1 ( ) & ( ) 4. ( ) Q1.? 2? Q2. Ruby? Q3. 44

1B 3 ( ) ( 1A ) 4 6 2 4 6 1 1. Subject: Report 1B 2. 3. 1 4. 5. 1 6. 7. Q1.? Q2.? Q3. 45

! ECC ( ECC ) ( ) ( ) ( ) ( ) 4 / / 46

( :? ) ( ) Subject: ^_^; Web PDF? 47