operator: pop-float
description:
pop-float ket
pops the trailing float in the given ket to the coefficient
if the starting ket has a coefficient then multiply it by this value
if the trailing value is not a float, then leave the ket unchanged
examples:
pop-float |3.2>
3.2| >
-- coefficient of 5, so multiply by 7:
pop-float 5|7>
35| >
pop-float |x: 2>
2|x>
-- again, multiply the coefficient by the value
pop-float 5.1|x: y: 2>
10.2|x: y>
-- y is not a float, so leave |x: y> unchanged
pop-float |x: y>
|x: y>
see also:
push-float, to-value, to-category
Home