The create function can be used to create a real number -
though this is almost never used! To create the real number 33.0
(create Real 33.0)
will work, but so will:
33.0
| method name | description |
|---|---|
| string | create a string holding the digits of this real no. |
| format | format the real no. according to the supplied format specification |
| integer | truncate this real number to an integer |
| real | copy this real no. |
== |
test whether this real no. is equal to the supplied one |
!= |
test whether this real no. is not equal to the supplied one |
< |
test whether this real no. is less than the supplied one |
> |
test whether this real no. is greater than the supplied one |
<= |
test whether this real no. is less than or equal to the supplied one |
>= |
test whether this real no. is greater than or equal to the supplied one |
| copy | copy this real no. |
+ |
return the sum of this real no. and the supplied one |
- |
return the result of this real no. minus the supplied one |
* |
return the result of this real no. multiplied by the supplied one |
/ |
return the result of this real no. divided by the supplied one |
Create a string holding the digits of this real no.
Arguments: none
Return type: String
format
Format the number according to the supplied format specification. The format
spec is the standard C printf spec. The following are valid examples:
"%06f"
"%*g"
If the format spec requires additional integer arguments, then these must be supplied
Arguments:
| formatSpec | String |
| ... | one or two Integers
to match the formatSpec
|
Return type: an appropriately formatted String
Truncate this real number to an integer.
Arguments: none
Return type: Integer
Copy this real no.
Arguments: none
Return type: Real
==Test whether this real no. is equal to the supplied one.
Arguments:
| x | Real |
Return type: Object
!=Test whether this real no. is not equal to the supplied one.
Arguments:
| x | Real |
Return type: Object
<Test whether this real no. is less than the supplied one.
Arguments:
| x | Real |
Return type: Object
>Test whether this real no. is greater than the supplied one.
Arguments:
| x | Real |
Return type: Object
<=Test whether this real no. is less than or equals the supplied one.
Arguments:
| x | Real |
Return type: Object
>=Test whether this real no. is greater than or equals the supplied one.
Arguments:
| x | Real |
Return type: Object
Copy this real no.
Arguments: none
Return type: Real
+Return the sum of this real no. and the supplied one.
Arguments:
| x | Real |
Return type: Real
-Return the result of this real no. minus the supplied one.
Arguments:
| x | Real |
Return type: Real
*Return the result of this real no. multiplied by the supplied one.
Arguments:
| x | Real |
Return type: Real
/Return the result of this real no. divided by the supplied one.
Arguments:
| x | Real |
Return type: Real
| Contents | Index | Current topic: objects | Related links: built-in objects |