precedence violation

View: New views
9 Messages — Rating Filter:   Alert me  

precedence violation

by doc_brown :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello, everybody

I think there is a serious bug such as precedence violation.

When I run the code

x= 1.0
print 2.718281828**(- x**2)

on Boo, I get 2.718281828. It looks like not only x, but -x is taken
to the power of 2.

On both CPython and IronPython the same code gives me correct result
0.367879441234.

I run Boo 0.8.2 0n .Net 3.5

Thank you very much for your attention.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---


Re: precedence violation

by doc_brown :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi everybody,

I know this topic may not be of general interest, or may be it is
known issue (still not fixed though)...

Could anyone just tell me how can I report a bug?

Boo is a greatest language I ever worked with and I just want to help
a little to keep it clean :).

Thanks a lot again guys, for otherwise excellent job.

On Jul 5, 10:33 am, doc_brown <vm_...@...> wrote:

> Hello, everybody
>
> I think there is a serious bug such as precedence violation.
>
> When I run the code
>
> x= 1.0
> print 2.718281828**(- x**2)
>
> on Boo, I get 2.718281828. It looks like not only x, but -x is taken
> to the power of 2.
>
> On both CPython and IronPython the same code gives me correct result
> 0.367879441234.
>
> I run Boo 0.8.2 0n .Net 3.5
>
> Thank you very much for your attention.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---


Re: precedence violation

by Rodrigo B. de Oliveira :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, Jul 7, 2008 at 12:58 PM, doc_brown <vm_tch@...> wrote:
>
> Could anyone just tell me how can I report a bug?
>

http://boo.codehaus.org/Contributors

See "If you find a bug or problem" section.

> Boo is a greatest language I ever worked with and I just want to help
> a little to keep it clean :).
>

Your support is appreciated!

Thanks!
Rodrigo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---


Re: precedence violation

by doc_brown :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thank you, Rodrigo, for quick reply.

And special thanks for Boo!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---


Re: precedence violation

by Justin Chase-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

you probably realized this but just in case, the following will work as you expect:


x= 1.0
print 2.718281828**(- (x**2))


On Sat, Jul 5, 2008 at 9:33 AM, doc_brown <vm_tch@...> wrote:

Hello, everybody

I think there is a serious bug such as precedence violation.

When I run the code

x= 1.0
print 2.718281828**(- x**2)

on Boo, I get 2.718281828. It looks like not only x, but -x is taken
to the power of 2.

On both CPython and IronPython the same code gives me correct result
0.367879441234.

I run Boo 0.8.2 0n .Net 3.5

Thank you very much for your attention.




--
Justin Chase
http://www.justnbusiness.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---


Re: precedence violation

by doc_brown :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yes, this what I finally did, it was no problem for me to make the
program work ( -Math.Pow(x**2)) is also a solution) ,

but don't you disagree that this simple language feature should work
the same as in other languages (and the issue should be reported :)) ?


But, anyway, thanks a lot for your time!



On Jul 7, 2:40 pm, "Justin Chase" <justin.m.ch...@...> wrote:

> you probably realized this but just in case, the following will work as you
> expect:
>
> x= 1.0
> print 2.718281828**(- (x**2))
>
>
>
> On Sat, Jul 5, 2008 at 9:33 AM, doc_brown <vm_...@...> wrote:
>
> > Hello, everybody
>
> > I think there is a serious bug such as precedence violation.
>
> > When I run the code
>
> > x= 1.0
> > print 2.718281828**(- x**2)
>
> > on Boo, I get 2.718281828. It looks like not only x, but -x is taken
> > to the power of 2.
>
> > On both CPython and IronPython the same code gives me correct result
> > 0.367879441234.
>
> > I run Boo 0.8.2 0n .Net 3.5
>
> > Thank you very much for your attention.
>
> --
> Justin Chasehttp://www.justnbusiness.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---


Re: precedence violation

by doc_brown :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Sorry, I mean ( -Math.Pow(x, 2))
Better not to mix styles :)))


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---


Re: precedence violation

by Justin Chase-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes I also would expect the precedence for the power operator to be higher than the minus as you have indicated, I just wanted to make sure you had an acceptable workaround for now.


On Mon, Jul 7, 2008 at 3:55 PM, doc_brown <vm_tch@...> wrote:

Sorry, I mean ( -Math.Pow(x, 2))
Better not to mix styles :)))






--
Justin Chase
http://www.justnbusiness.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---


Re: precedence violation

by doc_brown :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks so much, Justin,
I understand and appreciate that.

Victor
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang
-~----------~----~----~----~------~----~------~--~---