Quirrel4.41.0

types.Float.clone

Method on every float
clone(): any

Returns the float itself.

Return value

this, unchanged, for the same reason as types.Integer.clone: a float has no identity apart from its value.

Notes

Takes no arguments. clone is a keyword, so (3.5).clone() never parses; see types.Integer.clone for the operator and computed-index alternatives.

Example

examples/types/float/clone.nut
println("clone 3.5 =", clone 3.5)
let x = 3.5
println("x[\"clone\"]() == x =", x["clone"]() == x)
Output:
clone 3.5 = 3.5
x["clone"]() == x = true

See also

cloneReturns the integer itself.
cloneReturns the bool itself.
weakrefReturns the float itself.
floatclass index