When you're evaluating -12**2 you're essentially evaluating -(12**2).

And also, (-12) squared is always 144.

If you want to retain the sign use -(12**2). If you don't want the sign to be retained, use (-12)**2

If you're trying to evaluate the square root of a negative number. It is going to be the same as the sqrt of the positive number multiplied by imaginary i

Just evaluate negative numbers the same way you would positive numbers, and append i to it.

In your particular case, the min function is screwing things up when you evalute negative numbers

Answer from usernamenotfound on Stack Overflow
🌐
Reddit
reddit.com › r/python › if i want to use negative of a variable, is -var enough?
r/Python on Reddit: If I want to use negative of a variable, is -var enough?
February 16, 2019 -

Should I use answer = 0 - var or is answer = -var enough?

For those of you familiar with finance: I have the term S from black-scholes model set to the variable s, and depending on whether i say to value a call or a put, I will use s or -s

Discussions

working with negative numbers in python - Stack Overflow
#get user input of numbers as variables ... variables total = 0 count = 0 #output the total while (count< abs(numb)): total = total + numa count = count + 1 #testing statements if (numa, numb <= 0): print abs(total) else: print total · I want to do it without absolutes, but every time I input negative numbers I get a big fat goosegg. I know there is some simple way to do it, I just can't find it. ... And just to confuse things, input in Python 3 is the same ... More on stackoverflow.com
🌐 stackoverflow.com
How to convert positive numbers to negative in Python? - Stack Overflow
I know that abs() can be used to convert numbers to positive, but is there somthing that does the opposite? I have an array full of numbers which I need to convert to negative: array1 = [] arrayLen More on stackoverflow.com
🌐 stackoverflow.com
python - Space between negative sign and variable name - Software Engineering Stack Exchange
I tried doing a Google search, as well as searching this Stack Exchange site but could not find a question relating directly to this. The PEP 8 -- Style Guide for Python Code has lots of good style More on softwareengineering.stackexchange.com
🌐 softwareengineering.stackexchange.com
How to assign negative numbers in python
Use random.uniform(-0.3, 0.3). If you use choice(range) or randint, you are confined to whole values from the range, which then converts to tenths when divided, but presumably you want random floats in the range? More on reddit.com
🌐 r/learnpython
5
0
May 7, 2021
🌐
Boot.dev
boot.dev › lessons › e0fe3f7c-c0ee-4d02-be2c-b770ddfa477e
Learn Python for Beginners: Negative Numbers | Boot.dev
Negative numbers in Python work the way you probably expect. Just add a minus sign: ... When our hero walks through poison, their health should go down. Right now the hero is gaining 10 health instead of losing 10 health.
🌐
AlgoCademy
algocademy.com › link
Return Negative in Python | AlgoCademy
Create a function that takes a number as an argument and returns negative of that number.
🌐
Medium
mipsmonsta.medium.com › how-negative-numbers-are-represented-in-python-243c2a594015
How Negative Numbers are Represented in Python? | by Mipsmonsta | Medium
September 14, 2022 - If you print out the variable result, the output will be 4294967292. So how do we get back -4 from the bitstring of 11111111111111111111111111111100? ... def negativeRepToNumber(self, bitList: List[str]):""" In order to allow bit-wise operations, python represents negative number e.g.
🌐
GeeksforGeeks
geeksforgeeks.org › python › working-with-negative-numbers-in-python
Working with Negative Numbers in Python - GeeksforGeeks
July 23, 2025 - The number is negative. Python provides built-in functions for various mathematical operations, such as min(), max(), and sum().
🌐
Quora
quora.com › How-can-we-represent-negative-integers-in-Python
How can we represent negative integers in Python? - Quora
Answer (1 of 2): Integers are a built-in type in Python. The Python interpreter handles the common decimal representation for input and output, e.g. “-69”, but can be induced to input in other bases as well via the second argument to int. For output, bin, oct, and hex can be used for bases ...
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 64445167 › how-to-convert-positive-numbers-to-negative-in-python
How to convert positive numbers to negative in Python? - Stack Overflow
I know that abs() can be used to convert numbers to positive, but is there somthing that does the opposite? I have an array full of numbers which I need to convert to negative: array1 = [] arrayLen...
🌐
Pierian Training
pieriantraining.com › home › how to check if a number is negative in python: a beginner’s guide
How to Check if a Number is Negative in Python: A Beginner's Guide - Pierian Training
June 18, 2023 - To check if a number is negative in Python, you can use the comparison operator “<” to compare the number with 0. If the number is less than 0, it means that the number is negative.
🌐
AskPython
askpython.com › python-modules › numpy › numpy-negative
Numpy negative - Numerical negative, element-wise. - AskPython
February 16, 2023 - The NumPy module of Python provides a method for converting the positive elements of an array to negative elements. The method is called numpy.negative().
🌐
Programiz
programiz.com › python-programming › examples › positive-negative-zero
Python Program to Check if a Number is Positive, Negative or 0
To understand this example, you should have the knowledge of the following Python programming topics: ... num = float(input("Enter a number: ")) if num > 0: print("Positive number") elif num == 0: print("Zero") else: print("Negative number")
🌐
WsCube Tech
wscubetech.com › resources › python › programs › positive-negative-zero
Python Program to Check if a Number is Positive, Negative or 0
May 28, 2026 - Learn how to write a Python program to check if a number is positive, negative, or zero. Simple steps to determine the nature of any number using Python.
🌐
Code.mu
code.mu › en › python › book › prime › basis › negative-numbers
Negative Numbers in Python
Numbers can be negative. To do this, you need to put a minus sign before the number: ... Create a variable test with the value -100.
🌐
CodeSpeedy
codespeedy.com › home › how to convert a positive number into a negative in python
How to convert a positive number into a Negative in Python - CodeSpeedy
September 23, 2021 - Here, just simply I have multiplied the list of numbers with -1 so, it returns negative numbers at the end.
🌐
CodeRivers
coderivers.org › blog › how-to-make-something-negative-in-python
Making Something Negative in Python: A Comprehensive Guide - CodeRivers
February 22, 2026 - To make an integer negative, you simply prefix it with a minus sign (-). For example: positive_integer = 5 negative_integer = -positive_integer print(negative_integer) In this code, we first define a positive integer positive_integer with a value of 5. Then, we create a new variable ...
🌐
Kodeclik
kodeclik.com › how-to-make-something-negative-in-python
How to make a number negative in Python
September 16, 2024 - To make a number negative in Python, use 1. The Negation Operator. 2. Multiply by -1. 3. Use the abs() function with a negation. Or 4. Use a lambda function.