AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Suggestion] Notations, Prefixes, Symbols (https://forums.alliedmods.net/showthread.php?t=168393)

RollerBlades 09-28-2011 12:19

[Suggestion] Notations, Prefixes, Symbols
 
Im little bit tired of writing thoose big values when scripting and i wonder if its possible to break it down to something much shorter that not only are for making shorter code but for doing easier math when coding!

Example:

Notations Prefix Symbol
10 1 deka- da
10 2 hecto- h
10 3 kilo- k
10 6 mega- M
10 9 giga- G
10 12 tera- T
10 15 peta- P
10 18 exa- E
10 21 zeta- Z
10 24 yotta- Y


10 -1 deci- d
10 -2 centi- c
10 -3 milli- m
10 -6 micro-
10 -9 nano- n
10 -12 pico- p
10 -15 femto- f
10 -18 atto- a
10 -21 zepto- z
10 -24 yocto- y

is anyone capable of making this??

fysiks 09-28-2011 18:21

Re: [Suggestion] Notations, Prefixes, Symbols
 
What?

I'm guessing the answer will be it won't be worth the effort if it is even possible.

Emp` 09-28-2011 19:55

Re: [Suggestion] Notations, Prefixes, Symbols
 
You could make those as defines/constants and then just multiply them:

Code:

#define mega 1000000

//...

new var = 5 * mega;


nikhilgupta345 09-28-2011 20:03

Re: [Suggestion] Notations, Prefixes, Symbols
 
Quote:

Originally Posted by Emp` (Post 1565007)
You could make those as defines/constants and then just multiply them:

Code:

#define mega 1000000

//...

new var = 5 * mega;


Would it work to do this?
Code:

#define mega (* 1000000)

new var = 5 mega;


Emp` 09-28-2011 21:13

Re: [Suggestion] Notations, Prefixes, Symbols
 
Code:

#define mega  * 1000000

new var = 5 mega;


fysiks 09-29-2011 02:36

Re: [Suggestion] Notations, Prefixes, Symbols
 
I'm impressed. It still wouldn't have been worth my time IMO. lol

RollerBlades 09-29-2011 05:04

Re: [Suggestion] Notations, Prefixes, Symbols
 
could you fix a .inc file with all of them?

fysiks 09-29-2011 21:54

Re: [Suggestion] Notations, Prefixes, Symbols
 
Quote:

Originally Posted by RollerBlades (Post 1565157)
could you fix a .inc file with all of them?

You can do it, it's extremely simple. It will take you like 2 minutes.


All times are GMT -4. The time now is 19:39.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.