[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: variables `inheriting' values, rounding
From: |
Mike B. |
Subject: |
Re: variables `inheriting' values, rounding |
Date: |
Tue, 26 Jan 2010 17:16:09 -0800 (PST) |
Sorry for the HTML email-I've now selected `plain text' in yahoo mail so hope
this helps.
I'll look into your suggestions regarding settings parameter as a function.
I'm familiar with round, but was wondering if there is a already a pre-defined
`round' function which accepts the accuracy as a parameter.
Cheers.
--- On Wed, 27/1/10, Jordi Gutiérrez Hermoso <address@hidden> wrote:
> From: Jordi Gutiérrez Hermoso <address@hidden>
> Subject: Re: variables `inheriting' values, rounding
> To: address@hidden
> Cc: "John W. Eaton" <address@hidden>, "Octave mai. lis." <address@hidden>
> Date: Wednesday, 27 January, 2010, 2:34 AM
> Mike, although there isn't an
> official policy on this mailing list,
> I'd like to encourage you to not top-post and avoid HTML
> emails if
> possible. It's an old email convention many of us still
> like.
>
> 2010/1/26 Mike B. <address@hidden>
> > As an example. I have a structure A which is defined
> in the begining
> > of the code but it should actually inherit values from
> another
> > structure defined later, something like
> algorithm_parameters =
> > settings; . . . settings = [ 0, 0.4 ];
>
> My earlier suggestion to make settings a function that
> returns the
> actual values you want might work here, assuming that the
> overhead of
> a function call isn't a problem in your algorithm.
>
> Barring that, Octave can do functional programming rather
> well, so I
> would structure your code so that your algorithm is
> contained in a
> function and settings is a parameter to that function.
>
> > Also, is there a function to round real numbers to a
> certain
> > accuracy
>
> If you go to http://octave.sourceforge.net, click on
> function
> reference at the top and then look at the alphabetical
> list, you will
> find that round is a built-in function that rounds to the
> nearest
> integer. You can easily use this to round to whatever
> decimal place
> you want.
>
> HTH,
> - Jordi G. H.
>
Get your new Email address!
Grab the Email name you've always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
- variables `inheriting' values, Mike B., 2010/01/23
- Re: variables `inheriting' values, Jordi Gutiérrez Hermoso, 2010/01/25
- Re: variables `inheriting' values, Mike B., 2010/01/25
- Re: variables `inheriting' values, John W. Eaton, 2010/01/25
- variables `inheriting' values, rounding, Mike B., 2010/01/26
- Re: variables `inheriting' values, rounding, Jordi Gutiérrez Hermoso, 2010/01/26
- Re: variables `inheriting' values, rounding,
Mike B. <=
- Re: variables `inheriting' values, rounding, John W. Eaton, 2010/01/26
- Re: variables `inheriting' values, rounding, Mike B., 2010/01/27
Re: variables `inheriting' values, Dupuis, 2010/01/26