 |
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Sat Nov 14, 2009 7:25 pm
The use of %float |
Hey all
How are we supposed to do calculation in this software with numbers that are not integers?
I wonder if the syntaxing when calculating can be made more user-friendly.
E.g:
If I want to display the result of 10/3, the intuition in CMUD is to use
[/code]
#SHOW (10/3)
Code: |
and expect 3.333333333333 to be the answer... But what I get is 3.
In order to get the expected answer... one has to use:
|
#SHOW (%float(10)/%float(3))
Code: |
This is very clumsy imo...
To sum it up... can CMUD be made to use floating numbers as standard? Or is there a reason that it is the way it is? Like... being faster for internal operations?
//D |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Nov 14, 2009 7:30 pm |
This has always been the case, even in zMUD. Most people playing MUDs do not need floating point math and integer math is much much faster. It's easy to do floating point...just add the decimal to any number. For example:
#SHOW (10.0/3.0)
will show the 3.3333 that you expect. CMUD is NEVER going to use floating point math by default. |
|
|
 |
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Sat Nov 14, 2009 7:33 pm |
oh, handy... thanks :)
|
|
|
 |
orphean Apprentice

Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Sat Nov 14, 2009 7:39 pm |
Edit: Beaten by Zugg!
|
|
|
 |
|
|