Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (582)
games submitted by our members
Games in WIP (503)
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 1962 times)
0 Members and 1 Guest are viewing this topic.
Offline tom_mai78101
« Posted 2012-07-24 10: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.
1  
result = -result; //Negate the variable "result".

etc.

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

Example usage of NOT:

1  
boolean test = false; //(!test = true.)
   
1  
!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 10: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 10: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 11:08:15 »

Perfect. This is enough for me to continue my documentation for my work. Cheesy
Offline sproingie
« Reply #4 - Posted 2012-07-24 18:45:19 »

Don't forget bitwise negation with ~
Smiley
Offline Oskuro

JGO Coder


Medals: 32
Exp: 6 years


Coding in Style


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

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

1  
2  
3  
4  
boolean negateFlag(boolean flag)
{
    return !flag;
}


Obtaining the negative of a value is finding the inverse of said value. From http://en.wikipedia.org/wiki/Inverse_function:

Quote
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 12: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:

1  
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 12: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 12: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.

Online Roquen
« Reply #9 - Posted 2012-07-31 13: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 14: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 10: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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (72 views)
2014-04-15 18:08:23

BurntPizza (68 views)
2014-04-15 03:46:01

UprightPath (79 views)
2014-04-14 17:39:50

UprightPath (65 views)
2014-04-14 17:35:47

Porlus (80 views)
2014-04-14 15:48:38

tom_mai78101 (104 views)
2014-04-10 04:04:31

BurntPizza (164 views)
2014-04-08 23:06:04

tom_mai78101 (260 views)
2014-04-05 13:34:39

trollwarrior1 (210 views)
2014-04-04 12:06:45

CJLetsGame (220 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org 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‑gaming.org
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!