Velocity Reviews > Java > Quick n-th Square of BigInteger

Quick n-th Square of BigInteger

Eric Sosman
Guest
Posts: n/a

 06-08-2012
On 6/8/2012 5:19 PM, Jan Burse wrote:
> Eric Sosman schrieb:
>> ... and then do a binary search between those extrema. (Looks like
>> they'd differ by a factor of two usually, maybe a factor of four
>> occasionally -- but I might be wrong about that.)

>
> Binary search would use (x.bitCount()-1)/n steps in the
> extrem, and in each step calculating pow(). Is this
> effective?

In light of your abusiveness in responding to other people who've
tried to help, I decline to assist you any further. Have a nice life.

--
Eric Sosman
http://www.velocityreviews.com/forums/(E-Mail Removed)d

Jan Burse
Guest
Posts: n/a

 06-08-2012
Eric Sosman schrieb:
> In light of your abusiveness in responding to other people who've
> tried to help, I decline to assist you any further. Have a nice life.

Problem is I scribbled the exact same solution on
a back of an envelope, but I have doubt that it is
a good solution for small n, like n=2.

Bye

Lew
Guest
Posts: n/a

 06-08-2012
On Friday, June 8, 2012 2:34:40 PM UTC-7, Jan Burse wrote:
> markspace schrieb:
> > I'm confused about the max, the z |, and the =< x.

>
> For those who don't know, there exists a set builder notation:
>
> http://en.wikipedia.org/wiki/Set-bui...ion#Z_notation
>
> max is then a higher order function from a set to an element.
>
> Forgot where this is taught, in elementary school?

Riiiight. As nations and smaller school districts remove evolution from
their textbooks, they're going to teach mathematical logic and set
theory in elementary school?

In any event, this being a Java forum, the notation '=<' (shown nowhere
in your reference link, BTW) is rather odd, as we are used to '<='. Given
that '=<' apparently is not part of the "Set Builder" notation, how about
we stick with the Java (also C, Fortran, C++, C#, Javascript, BASIC, SQL,
Python, shell, ...) idiom?

--
Lew

Jan Burse
Guest
Posts: n/a

 06-08-2012
Lew schrieb:
> In any event, this being a Java forum, the notation '=<' (shown nowhere
> in your reference link, BTW) is rather odd, as we are used to '<='. Given
> that '=<' apparently is not part of the "Set Builder" notation, how about
> we stick with the Java (also C, Fortran, C++, C#, Javascript, BASIC, SQL,
> Python, shell, ...) idiom?

It was not Java, it was a math spec. When one writes:

Given: xxx
Compute: yyy

Then xxx and yyy are not necessarely needed to follow
the Java language specification.

Do you want me to start counting the trolls that will
now make their appearance in this thread? You are
number 3 so far. I guess there will follow some more...

Bye

Jan Burse
Guest
Posts: n/a

 06-08-2012
Jan Burse schrieb:
> Do you want me to start counting the trolls that will
> now make their appearance in this thread? You are
> number 3 so far. I guess there will follow some more...

But still comp.lang.java.programmer is too small
I guess so that a shitstorm will rise. And there are
still some that want to profit.

Bye

Lew
Guest
Posts: n/a

 06-08-2012
On Friday, June 8, 2012 2:43:37 PM UTC-7, Jan Burse wrote:
> Eric Sosman schrieb:
> > In light of your abusiveness in responding to other people who've
> > tried to help, I decline to assist you any further. Have a nice life.

>
> Problem is I scribbled the exact same solution on
> a back of an envelope, but I have doubt that it is
> a good solution for small n, like n=2.

For n == 2, just use any of the standard algorithms for square root, like
<http://stackoverflow.com/questions/3432412/calculate-square-root-of-a-biginteger-system-numerics-biginteger?rq=1>
found in about 10 minutes of online searching.

--
Lew

Lew
Guest
Posts: n/a

 06-08-2012
On Friday, June 8, 2012 2:47:05 PM UTC-7, Jan Burse wrote:
> Lew schrieb:
> > In any event, this being a Java forum, the notation '=<' (shown nowhere
> > in your reference link, BTW) is rather odd, as we are used to '<='. Given
> > that '=<' apparently is not part of the "Set Builder" notation, how about
> > we stick with the Java (also C, Fortran, C++, C#, Javascript, BASIC, SQL,
> > Python, shell, ...) idiom?

>
> It was not Java, it was a math spec. When one writes:
>
> Given: xxx
> Compute: yyy
>
> Then xxx and yyy are not necessarely needed to follow
> the Java language specification.
>
> Do you want me to start counting the trolls that will
> now make their appearance in this thread? You are
> number 3 so far. I guess there will follow some more...

A troll is not someone who suggests that you be clear in
your communication, but someone who gets personally
abusive as you did when given such a suggestion.

Oh, darn, I forgot. You're the same person who suggests
that one perform a sex act on you when they try to engage
in any technical discussion with you. How do you feel you have
the moral authority to accuse anyone else of being a troll?

Because you don't.

Matthew 7:5.

--
Lew

Jan Burse
Guest
Posts: n/a

 06-08-2012
Lew schrieb:
> A troll is not someone who suggests that you be clear in
> your communication, but someone who gets personally
> abusive as you did when given such a suggestion.

=< should be cristal clear, = = equal and < = less.
And if it is not cristal clear on first sight, it will
become clear from reading the context. In the present
case a troll is somebody who pretends not understand
a post, when he does.

Bye

Lew
Guest
Posts: n/a

 06-08-2012
On Friday, June 8, 2012 3:00:36 PM UTC-7, Jan Burse wrote:
> Lew schrieb:
> > A troll is not someone who suggests that you be clear in
> > your communication, but someone who gets personally
> > abusive as you did when given such a suggestion.

>
> =< should be cristal clear, = = equal and < = less.
> And if it is not cristal clear on first sight, it will
> become clear from reading the context. In the present
> case a troll is somebody who pretends not understand
> a post, when he does.

I don't know whom you mean. No one here pretended not
to understand it, only suggested that you follow the conventions
appropriate to the forum.

Stop being so nasty and confrontational, Jan. If you can't play
nice, stay off the playground. You're being mean without any
need.

--
Lew

Jan Burse
Guest
Posts: n/a

 06-08-2012
Lew schrieb:
> Stop being so nasty and confrontational, Jan. If you can't play
> nice, stay off the playground. You're being mean without any
> need.

Suck my dick, shut up and **** off.