Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7237

Re: Using functions to return something

Path csiph.com!goblin2!goblin.stu.neva.ru!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From jacki <collector@idealan.pl>
Newsgroups comp.lang.ruby
Subject Re: Using functions to return something
Date Wed, 20 Apr 2016 10:30:20 +0200
Organization ATMAN - ATM S.A.
Lines 24
Message-ID <57173E1C.2050905@idealan.pl> (permalink)
References <b1e27c74-cf34-49c3-a4a1-85f55f0e55cd@googlegroups.com> <dnn7koFrj3gU1@mid.individual.net> <69f480e7-0d0b-4fc7-bd69-49fc2f6540c4@googlegroups.com>
NNTP-Posting-Host biuro.idealan.pl
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-Trace node2.news.atman.pl 1461141015 12668 178.212.148.2 (20 Apr 2016 08:30:15 GMT)
X-Complaints-To usenet@atman.pl
NNTP-Posting-Date Wed, 20 Apr 2016 08:30:15 +0000 (UTC)
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
To Cai Gengyang <gengyangcai@gmail.com>
In-Reply-To <69f480e7-0d0b-4fc7-bd69-49fc2f6540c4@googlegroups.com>
Xref csiph.com comp.lang.ruby:7237

Show key headers only | View raw


W dniu 2016-04-20 o 07:28, Cai Gengyang pisze:
> 
> This is what I did :
> 
> I created a file , defined a new variable c and saved it as ex50.rb ---
> 
> def add(a, b, c)   

a, b and c - three arguments

> 
> age = add(30, 10) / 5 
> 

then you are calling function with two arguments and divide what
function returns by 5 - really?

And remember, that 7/3 = 2 not 2.333(3) because:
2.2.0 :005 > 7.class
 => Fixnum

and Fixnum / Fixnum = Fixnum

Back to comp.lang.ruby | Previous | NextPrevious in thread | Find similar


Thread

Using functions to return something Cai Gengyang <gengyangcai@gmail.com> - 2016-04-19 07:06 -0700
  Re: Using functions to return something Robert Klemme <shortcutter@googlemail.com> - 2016-04-19 19:19 +0200
    Re: Using functions to return something Cai Gengyang <gengyangcai@gmail.com> - 2016-04-19 22:28 -0700
      Re: Using functions to return something Sebastian Christ <rudolfo.christ@gmail.com> - 2016-04-20 09:25 +0200
        Re: Using functions to return something Cai Gengyang <gengyangcai@gmail.com> - 2016-04-20 04:12 -0700
          Re: Using functions to return something Sebastian Christ <rudolfo.christ@gmail.com> - 2016-04-20 15:42 +0200
            Re: Using functions to return something Kaz Kylheku <545-066-4921@kylheku.com> - 2016-04-20 14:34 +0000
              Re: Using functions to return something Sebastian Christ <rudolfo.christ@gmail.com> - 2016-04-20 20:48 +0200
                Re: Using functions to return something Kaz Kylheku <545-066-4921@kylheku.com> - 2016-04-20 19:27 +0000
      Re: Using functions to return something jacki <collector@idealan.pl> - 2016-04-20 10:30 +0200

csiph-web