On Java, it make more sense to write as what you wrote in paper:

r = Math.sqrt(a*a + b*b)

So is there any better way to write math expression other than the above, e.g: like Java?

CretinHoTue 15 Jun

Oh, it's getting insane:

r := a.mult(a).plus(b.mult(b)).sqrt

SlimerDudeTue 15 Jun

r := ((a*a) + (b*b)).sqrt - any better?

CretinHoTue 15 Jun

SlimerDude: still backward to what I normally write in Java but if it's the only style to write it on Fantom then I think I have to live with it! BTW, adding more redundancy brackets just make things more difficult to read. I still think my original is better:

r := (a*a + b*b).sqrt

SlimerDudeTue 15 Jun

adding more redundancy brackets just make things more difficult to read.

Ah - I never did learn operator precedence, so I have to do it the long way!

still backward to what I normally write in Java

Maybe, but that's static methods vs instance methods for you! I personally liked the way Fantom moved everything to instance methods, it makes them easier to find!

## CretinHo Tue 15 Jun

Current now, I have to write like this:

r := (a*a + b*b).sqrt

On Java, it make more sense to write as what you wrote in paper:

r = Math.sqrt(a*a + b*b)

So is there any better way to write math expression other than the above, e.g: like Java?

## CretinHo Tue 15 Jun

Oh, it's getting insane:

r := a.mult(a).plus(b.mult(b)).sqrt

## SlimerDude Tue 15 Jun

`r := ((a*a) + (b*b)).sqrt`

- any better?## CretinHo Tue 15 Jun

SlimerDude: still backward to what I normally write in Java but if it's the only style to write it on Fantom then I think I have to live with it! BTW, adding more redundancy brackets just make things more difficult to read. I still think my original is better:

r := (a*a + b*b).sqrt

## SlimerDude Tue 15 Jun

Ah - I never did learn operator precedence, so I

haveto do it the long way!Maybe, but that's static methods vs instance methods for you! I personally liked the way Fantom moved everything to instance methods, it makes them easier to find!