Quirrel4.41.0

types.Float.weakref

Method on every float
weakref(): any

Returns the float itself.

Return value

this, unchanged - not a weakref value.

Notes

A float is never reference counted, so there is nothing for sq_weakref to point a real weakref at; see types.Integer.weakref for the full mechanism, including why the signature's shown receiver, (table|userdata|instance|class|null), does not name float either.

Example

examples/types/float/weakref.nut
// Floats are not reference counted either, so this returns the value itself.
let wr = (3.5).weakref()
println("wr =", wr)
println("type(wr) =", type(wr))
Output:
wr = 3.5
type(wr) = float

See also

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