Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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 2406 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.
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 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 ~
Smiley
Offline Oskuro

JGO Knight


Medals: 40
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:

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

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 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.

 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (41 views)
2014-10-17 03:59:02

Norakomi (33 views)
2014-10-16 15:22:06

Norakomi (26 views)
2014-10-16 15:20:20

lcass (30 views)
2014-10-15 16:18:58

TehJavaDev (59 views)
2014-10-14 00:39:48

TehJavaDev (60 views)
2014-10-14 00:35:47

TehJavaDev (50 views)
2014-10-14 00:32:37

BurntPizza (66 views)
2014-10-11 23:24:42

BurntPizza (38 views)
2014-10-11 23:10:45

BurntPizza (80 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!