Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (768)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (854)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  To convert a positive number X into a negative number (-X) is called "negating"?  (Read 8867 times)
0 Members and 1 Guest are viewing this topic.
Offline tom_mai78101
« Posted 2012-07-24 08:34:20 »

Negate [verb] (used without object) - To be negative;  bring or cause negative.

I'm looking for a programming term used to mean "a way to convert a positive number into its negative form."

For example:

10. I "negate" that to -10.
23. After negation: -23.
-15. Negate it. 15.
result = -result; //Negate the variable "result".


It's comparable to how I think I use the word NOT, or !, in daily usage.

Example usage of NOT:

boolean test = false; //(!test = true.)
!1; //Value is 0 or 0x0

Example usage of NOT in sentences:

"See this flag? Use the NOT value of the flag."
"Try NOTting the value and NOR it with the result."
"NOT the XOR value from the base."

Is the word "negate" optimal for the usage of such scenario? Thanks in advance.
Offline UprightPath
« Reply #1 - Posted 2012-07-24 08:38:31 »

Depending on whether the search engine in question allows it (I believe that google does) "Logical Not" might work. If that fails, negation may or may not work. It really depends on what you're trying to find out in a given situation and where your searches are being executed, as well as how the writers of a given site/paper used the term.

Offline jonjava
« Reply #2 - Posted 2012-07-24 08:40:08 »

Optimal? .. I guess. At the very least it's perfectly fine.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tom_mai78101
« Reply #3 - Posted 2012-07-24 09:08:15 »

Perfect. This is enough for me to continue my documentation for my work. Cheesy
Offline sproingie

JGO Kernel

Medals: 202

« Reply #4 - Posted 2012-07-24 16:45:19 »

Don't forget bitwise negation with ~
Offline Oskuro

JGO Ninja

Medals: 77
Exp: 10 years

Coding in Style

« Reply #5 - Posted 2012-07-27 16:43:50 »

Negation, in computer science, is used to refer to NOT operations, like:

boolean negateFlag(boolean flag)
    return !flag;

Obtaining the negative of a value is finding the inverse of said value. From

In mathematics, an inverse function is a function that undoes another function: If an input x into the function ƒ produces an output y, then putting y into the inverse function g produces the output x, and vice versa. i.e., ƒ(x)=y, and g(y)=x. More directly, g(ƒ(x))=x, meaning g(x) composed with ƒ(x) leaves x unchanged.
A function ƒ that has an inverse is called invertible; the inverse function is then uniquely determined by ƒ and is denoted by ƒ−1 (read f inverse, not to be confused with exponentiation).

As such, a -1 is not necessarily the negation of 1, as it is not a boolean true/false statement. In programming, sometimes integer values are used in lieu of boolean values, but generally they are either part of an evaluation that returns a boolean result, like if(x >= y), or, when used to act as a boolean flag, the compiler (generally) only checks if the value is zero (0) for FALSE and any other value for TRUE.

Offline tom_mai78101
« Reply #6 - Posted 2012-07-31 10:17:21 »

For the compiler, if the value is any number other than 0 (FALSE), and I want a word used as a verb, a word which it describes an action that allows me to do the following math:

f(x) = -x

Would I use the word "inverse"?

I read the very last reply, and by that, I felt the word "negate" may confuse readers of my documentation. As in, it's now more unreliable than I expected at first.
Offline jonjava
« Reply #7 - Posted 2012-07-31 10:57:12 »

Inverse of x is 1/x;

IIRC Inverse just means the switching of positions of the head and tail. I.e, since (x == x/1) thus the inverse is therefore 1/x.

When talking about mathematics like this, it's best to talk in mathematics, i.e, provide examples instead of relying on pure literature.

I mean, the function is defined as "f(x) = -x", you can't define it any better than that. In words it'd be something like for every number x inserted into the function f you would get -x or something silly like that.

Offline UprightPath
« Reply #8 - Posted 2012-07-31 10:58:46 »

For x = !x negation or logical inverse is correct.
For x = -x Algebraic Negation or Additive Inverse is correct.

However, if you're worried that your readers will get confused by the use of 'Negation' or 'Inverse' in these cases, then you're probably focusing on the wrong thing. If you're still worried, select whichever word you like best, define it as succinctly as you can, then proceed to write the rest of your documentation and your language.

Inverse of x is 1/x;
Is Multiplicative Inverse. Which is, honestly, the more 'usual' use of the term 'inverse' in mathematics. At least, I know that I've had math teachers correct me when I use x = - x to define 'inverse' as a general term. However, if you say 'inverse: x = -x' in a definition, I doubt that there would be much confusion, especially if there's any sort of context where it's used.

Offline Roquen

JGO Kernel

Medals: 518

« Reply #9 - Posted 2012-07-31 11:29:58 »

Natural language is by nature ambitious.  Give a one liner in English and give the math form and move on.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jonjava
« Reply #10 - Posted 2012-07-31 12:15:29 »

Better yet, combine the two and punch the reader in the face with a math pun.

Offline tom_mai78101
« Reply #11 - Posted 2012-08-01 08:44:52 »

Alright, everything's clear now. Thanks, everyone!
Pages: [1]
  ignore  |  Print  

EgonOlsen (1340 views)
2018-06-10 19:43:48

EgonOlsen (1229 views)
2018-06-10 19:43:44

EgonOlsen (939 views)
2018-06-10 19:43:20

DesertCoockie (1380 views)
2018-05-13 18:23:11

nelsongames (1112 views)
2018-04-24 18:15:36

nelsongames (1374 views)
2018-04-24 18:14:32

ivj94 (2120 views)
2018-03-24 14:47:39

ivj94 (1269 views)
2018-03-24 14:46:31

ivj94 (2286 views)
2018-03-24 14:43:53

Solater (808 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!