ket fn: push-float


push-float:
    description:
        push-float ket
        push the float coefficient c onto the ket label
        so that c is now the "value" of the ket
        often useful if you want to swap between manipulating the coeff versus the value of a ket
        NB: it uses default-decimal-places as the max number of digits to use
        NB: the max of which seems to be 5, probably due to the limit in precision of floats
        push-float is the approximate inverse of pop-float

    examples:
        push-float 2.5|x>
            |x: 2.5>

        -- | > is a special ket that effectively has no "category"
        push-float 3.1415| >
            |3.1415>

        push-float 3.14159265| >
            |3.14159>

        -- if the ket has no explicit coeff, then the actual coeff is 1
        push-float |alpha>
            |alpha: 1>

    see also:
        pop-float, extract-value, extract-category

Home