ket fn: pop-float


pop-float:
    description:
        pop-float ket
        pop the "value" of the ket onto the coefficient
        the coefficient of the ket is multiplied by the ket value
        and the value is removed from the ket label
        often useful if you want to swap between manipulating the coeff versus the value of a ket
        if the ket value is not a number, then simply return the original ket
        pop-float is the approximate inverse of push-float

    examples:
        pop-float |x: 2.5>
            2.500000|x>

        -- if the ket only has a value, then use the special ket | >
        pop-float |3.1415>
            3.141500| >

        -- if the value is not a number, then return the original ket:
        pop-float |alpha>
            |alpha>

        -- if the ket has a coeff other than 1, then multiply it:
        pop-float 10 |x: 7.259>
            72.590000|x>

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

Home