#Quick question

1 messages ยท Page 1 of 1 (latest)

fervent bay
#

how to make a negative Math Square?

glossy axleBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
How to make a negative Math Square?

To clarify your question: if by "make a negative Math Square" you mean obtaining the negative of a squared number in Java, you can simply square the number using Math.pow() or the * operator and then negate the result. For example:

double result = -Math.pow(x, 2);

or

int result = -(x * x);

This gives you the negative of the square of x. Remember, the square of any real number is non-negative, so negating it produces a negative or zero value depending on the input.


Useful links:

fervent bay
#

As if we have:
int num = Math.sqrt(2)
to return a positive number, then how we return it as a negative

#

So if we say if the number is 4, and we get 2 from the square of it, then how we can get -2

#

As i tried all ways, but i can't remember how to do it

lean garden
#

-1 * Math.sqrt(2)

fervent bay
#

I tried all ways

#

And didn't though of that

#

Thanks man!

lean garden
#

๐Ÿ‘Œ

#

u can also put a minus before i think

#

-Math.sqrt(x)

fervent bay
fervent bay
#

But js forgot completly the form on how to make it negative

fervent bay