Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (207)
games submitted by our members
Games in WIP (781)
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 5172 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 Knight

Medals: 59
Exp: 6 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
« 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  
You cannot reply to this message, because it is very, very old.

Galdo (328 views)
2017-01-12 13:44:09

Archive (486 views)
2017-01-02 05:31:41

0AndrewShepherd0 (948 views)
2016-12-16 03:58:39

0AndrewShepherd0 (887 views)
2016-12-15 21:50:57

Lunch (1019 views)
2016-12-06 16:01:40

ral0r2 (1252 views)
2016-11-23 16:08:26

ClaasJG (1349 views)
2016-11-10 17:36:32

CoffeeChemist (1363 views)
2016-11-05 00:46:53

jay4842 (1445 views)
2016-11-01 19:04:52

theagentd (1230 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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!