String Maths Library
V1 - 2008/02/30
Do you want to use really large numbers?
Do you want to use really small numbers?
Do you need to mix really large numbers and small numbers?
Do you wish you could use decimal numbers?
This could be the answer to your problems.
This is a package to support arithmetic operations on numeric strings - O.K. I named it String Maths, but it is really String Arithmetic..
It works on:-
- numeric strings,
- signed numeric strings - leading or trailing signs.
- decimal strings (sign optional).
It performs:-
- '+' Add
- '-' Subtract
- '*' Multiply
On decimal and/or non-decimal strings.
- '/' Divide - non-decimal returns quotient and remainder in an array, decimal returns a decimal string.
- '//' Forced Divide - return a decimal result from two non-decimal input strings.
It currently supports a choice of two decimal point characters - main.44 uses a full stop while main.49 uses a comma.
You can add your own character to use as a decimal point if you require it. Instructions are in the "Usage" file and in the main.xx scripts themselves.
You can also select whether to have leading '+' signs included or not - there is no choice for negative result strings, they will always have a leading '-' sign.
Decimal output is to a default of 20 decimal places, if either input string has more, then that is taken as the default. It also includes rounding to the selected number of places.
The output is normally a signed string, the exceptions are:-
- Non-decimal divide will return an array of quotient and remainder.
- An error will return a NUMBER, not a string. See "Usage" for how to cope with these different outputs.
The only ouput message from the basic library is from the main.xx - if you specify a decimal point string rather than a single character.
The additional script to format the output for display does issue error mesages, as it is also meant for stand-alone use.
This package contains:
* All the scripts required to perform the above.
* The ReadMe text which gives more information about the package.
* The Usage text which has information on how to use the package and the error returns.
* Various texts describing the methods and problems implementing this package.
* The scripts in text format for perusal (don't laugh too loudly).
* It also contains a straight text list of all the Editor commands.
All in a .zip file, ready for you to use as you wish.
Available courtesy of Xai Corporation String Maths
[Library Scripts] String Maths by B O F
The place to discuss scripting and game modifications for X³: Reunion.
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
1 post
• Page 1 of 1
-
- Posts: 724
- Joined: Sat, 21. Feb 04, 02:15
[Library Scripts] String Maths by B O F
Post by B-O'F »
1 post
• Page 1 of 1
Return to “X³: Reunion - Scripts and Modding”
Jump to
- English Forums
- ↳ X4: Foundations
- ↳ X4: Foundations - Spoilers
- ↳ X4: Foundations - Technical Support
- ↳ X4: Foundations - Scripts and Modding
- ↳ Construction Community
- ↳ X Wiki Discussion
- ↳ X Rebirth Universe
- ↳ X Rebirth VR Edition
- ↳ X Rebirth - Technical Support
- ↳ X Rebirth - Scripts and Modding
- ↳ X³: Farnham's Legacy
- ↳ X³: Farnham's Legacy - Scripts and Modding
- ↳ X Trilogy Universe
- ↳ X³: Terran Conflict / Albion Prelude / Farnham's Legacy - Technical Support
- ↳ X³: Terran Conflict / Albion Prelude - Scripts and Modding
- ↳ X³: Reunion, X²: The Threat, X-T and X-BTF - Technical Support
- ↳ X³: Reunion - Scripts and Modding
- ↳ X²: The Threat - Scripts and Modding
- ↳ Creative Universe
- ↳ Off Topic English
- Deutschsprachige Foren
- ↳ X4: Foundations
- ↳ X4: Foundations - Spoilers
- ↳ X4: Foundations - Technische Unterstützung
- ↳ X4: Foundations - Scripts und Modding
- ↳ X Rebirth Universum
- ↳ X Rebirth VR Edition
- ↳ X Rebirth - Technische Unterstützung
- ↳ X Rebirth - Scripts und Modding
- ↳ X³: Farnham's Legacy
- ↳ X³: Farnham's Legacy - Scripts und Modding
- ↳ X Trilogie Universum
- ↳ X³: Terran Conflict / Albion Prelude / Farnham's Legacy - Technische Unterstützung
- ↳ X³: Terran Conflict / Albion Prelude - Scripts und Modding
- ↳ X³: Reunion, X²: Die Bedrohung, X-T und X-BTF - Technische Unterstützung
- ↳ X³: Reunion - Scripts und Modding
- ↳ X²: Die Bedrohung - Scripts und Modding
- ↳ Kreative Zone
- ↳ Off Topic Deutsch
- Forum Français
- ↳ X4: Foundations
- ↳ Support et Aide pour X4: Foundations
- ↳ Script et Modding pour X4: Foundations
- ↳ L'Univers X Rebirth
- ↳ Support et Aide pour X Rebirth
- ↳ Script et Modding pour X Rebirth
- ↳ Support et Aide pour la Trilogie X
- ↳ L'Univers de la Trilogie X
- ↳ Script et Modding pour la Trilogie X
- ↳ Off Topic Français
- Forum Italiano
- ↳ X4: Foundations
- ↳ Supporto Tecnico per X4: Foundations
- ↳ Script e Modding per X4: Foundations
- ↳ L'Universo di X Rebirth
- ↳ Script e Modding per X Rebirth
- ↳ Supporto Tecnico per X Rebirth
- ↳ L'Universo della Trilogia di X
- ↳ Script e Modding per la Trilogia di X
- ↳ Supporto Tecnico per la Trilogia di X
- ↳ Off Topic Italiano
- Polskie Fora
- ↳ Polskie / Polish X-Forum
- ↳ Polskie / Polish Off Topic
- Other Languages
- ↳ Česky / Czech X-Forum
- ↳ Dansk / Danish X-Forum
- ↳ Español / Spanish X-Forum
- ↳ Nederlands / Dutch X-Forum
- ↳ Português / Portuguese X-Forum
- ↳ Русский / Russian X-Forum
- DevNet: General
- ↳ MSCI Reference
- DevNet: X4: Foundations
- DevNet: X Rebirth
- ↳ XR - Technical Troubleshooting