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


Groups > comp.graphics.apps.gnuplot > #2853

Re: Curiosity: Arithmetic operations and leading zeros

Date 2015-04-01 06:25 -0500
From Richard Owlett <rowlett@cloud85.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Curiosity: Arithmetic operations and leading zeros
References <b286ed07-4f0a-4fd2-bf03-dd3176de25f0@googlegroups.com>
Message-ID <D4WdnR9wePZdSIbInZ2dnUU7-UOdnZ2d@supernews.com> (permalink)

Show all headers | View raw


j.strecha@gmail.com wrote:
> Hi,
>
> I recently discovered something curious about arithmetic operations in gnuplot:
>
>> gnuplot> print 2*66
>> 132
>> gnuplot> print 2*066
>> 108
>
> (gnuplot 5.0 patchlevel rc2)
>
> Apparently the multiplication behaves differently when leading zeros are present. Is this a bug, or a feature?
>
> Regards,
> JS
>

How does gnuplot handle input of octal numbers? {I don't have 
gnuplot on this machine to check.)

I notice that for your example that for example shown the answer 
is correct for octal input and defaulting to decimal on output.

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Curiosity: Arithmetic operations and leading zeros j.strecha@gmail.com - 2015-04-01 03:43 -0700
  Re: Curiosity: Arithmetic operations and leading zeros Richard Owlett <rowlett@cloud85.net> - 2015-04-01 06:25 -0500
    Re: Curiosity: Arithmetic operations and leading zeros j.strecha@gmail.com - 2015-04-01 05:57 -0700
      Re: Curiosity: Arithmetic operations and leading zeros Karl <mail.kfr@gmx.net> - 2015-04-02 20:43 +0200

csiph-web