Difference between revisions of "ObjectType:float64"
Jump to navigation
Jump to search
(Created page with "{{ObjectType-Vitals|float64|LavishScript|none|The string representation of this float64, to the nearest hundredth|float64|no|double}} == Description...") |
|||
Line 2: | Line 2: | ||
== Description == | == Description == | ||
A float64, named for its <tt>floating-point</tt>, represents a number with a [http://dictionary.reference.com/search?q=mantissa mantissa] to 64 bits of precision. | A float64, named for its <tt>floating-point</tt>, represents a number with a [http://dictionary.reference.com/search?q=mantissa mantissa] to 64 bits of precision. | ||
+ | |||
== Members == | == Members == | ||
Line 11: | Line 12: | ||
* [[ObjectType:int64|int64]] '''Ceil''': The value of this float, to its largest partial number (e.g. for 1.1 this is 2, for -0.1 this is 0). | * [[ObjectType:int64|int64]] '''Ceil''': The value of this float, to its largest partial number (e.g. for 1.1 this is 2, for -0.1 this is 0). | ||
* [[ObjectType:int|int]] '''Round''': The value of this float, rounded to the nearest whole number | * [[ObjectType:int|int]] '''Round''': The value of this float, rounded to the nearest whole number | ||
+ | * [[ObjectType:bool|bool]] '''Between[a,b]''': TRUE if a<= value and value <= b | ||
+ | * [[ObjectType:bool|bool]] '''Equal['''[[LavishScript:Mathematical Formulae|formula]]''']''': TRUE if the float64 matches the specified value | ||
+ | * [[ObjectType:string|string]] '''AsJSON''': A string with the value of the float64, as would be in JSON | ||
+ | |||
== Methods == | == Methods == | ||
Line 18: | Line 23: | ||
* '''Dec['''[[LavishScript:Mathematical Formulae|formula]]''']''': Decrements this float64 by a given amount | * '''Dec['''[[LavishScript:Mathematical Formulae|formula]]''']''': Decrements this float64 by a given amount | ||
* '''Set['''[[LavishScript:Mathematical Formulae|formula]]''']''': Sets this float64 to a given value | * '''Set['''[[LavishScript:Mathematical Formulae|formula]]''']''': Sets this float64 to a given value | ||
+ | |||
== Examples == | == Examples == | ||
Line 32: | Line 38: | ||
*bankcash1:Inc[${bankcash2}] | *bankcash1:Inc[${bankcash2}] | ||
:'''Note:''' These two commands are identical | :'''Note:''' These two commands are identical | ||
+ | |||
== See Also == | == See Also == | ||
{{LavishScript:ObjectType}} | {{LavishScript:ObjectType}} |
Latest revision as of 14:22, 14 October 2019
float64 | |
Defined By | LavishScript |
Inherits | none |
Reduces To | The string representation of this float64, to the nearest hundredth |
Variable Object Type | float64 |
Uses Sub-Types | no |
C/C++ Type | double |
Contents
Description
A float64, named for its floating-point, represents a number with a mantissa to 64 bits of precision.
Members
- string Deci: The value of this float, to the nearest tenth
- string Centi: The value of this float, to the nearest hundredth
- string Milli: The value of this float, to the nearest thousandth
- int64 Int: The value of this float, to its largest whole number (e.g. for 1.9 this is 1, for -0.1, this is -1)
- string Precision[#]: The value of this float, to the nearest # decimal places (e.g. 1 is tenths, 2 is hundredths, 3 is thousandths, and so on)
- int64 Ceil: The value of this float, to its largest partial number (e.g. for 1.1 this is 2, for -0.1 this is 0).
- int Round: The value of this float, rounded to the nearest whole number
- bool Between[a,b]: TRUE if a<= value and value <= b
- bool Equal[formula]: TRUE if the float64 matches the specified value
- string AsJSON: A string with the value of the float64, as would be in JSON
Methods
- Inc: Increments this float64 by 1.0
- Inc[formula]: Increments this float64 by a given amount
- Dec: Decrements this float64 by 1.0
- Dec[formula]: Decrements this float64 by a given amount
- Set[formula]: Sets this float64 to a given value
Examples
Declare a float variable
- Declare Faction float64
Set a variable to a given number
- Faction:Set[3912.392]
Increment a float64 variable
- Faction:Inc
Decrement a float64 variable
- Faction:Dec
Add two float64 variables
- bankcash1:Set[${bankcash1}+${bankcash2}]
- bankcash1:Inc[${bankcash2}]
- Note: These two commands are identical
See Also
LavishScript Object Types
- Text
- string - mutablestring - unistring
- Numbers
- byte - float - float64 - int - uint - int64
- Boolean (TRUE/FALSE)
- bool
- Pointers
- boolptr - byteptr - floatptr - float64ptr - intptr - uintptr - int64ptr - rgbptr - stringptr
- Containers
- objectcontainer - array - index - collection - queue - stack - set - variablescope
- JSON
- jsonobject - jsonarray - jsonvaluecontainer - jsonvalue
- Iteration
- iterator - jsoniterator
- Date/Time
- time
- File Handling
- filepath - file - filelist - filelistentry
- Tasks
- lavishmachine - Accessed via the Top-Level Object LMAC
- task - tasklibrary - taskmanager - tasktype - taskpulseargs - elmactaskstate