@@ -319,7 +319,10 @@
319319 ;~ pose
320320 %+ cook
321321 |= x=@rd [%float x]
322− parse-float
322+ ;~ pose
323+ parse-float
324+ parse-hex-float
325+ ==
323326 ::
324327 %+ cook
325328 |= x=@u [%int x]
@@ -585,6 +588,52 @@
585588 ==
586589 ==
587590 ==
591+++ parse-hex-float
592+ %+ knee *@rd
593+ |.
594+ =<
595+ %+ sear
596+ |= [* * int=tape frac=(unit tape) exp=(unit [exp-sign=? exp=@])]
597+ ?: ?=([~ ~] [frac exp]) ~
598+ %- some
599+ =/ frac (fall frac "")
600+ =/ whole=@rd (sun:rd (scan (weld int frac) hex))
601+ =/ frac-exp=@rd (sun:rd (pow 16 (lent frac)))
602+ =/ without-exp (div:rd whole frac-exp)
603+ ?~ exp without-exp
604+ =/ exp-exp (sun:rd (pow 2 exp.u.exp))
605+ ?: exp-sign.u.exp
606+ (mul:rd without-exp exp-exp)
607+ (div:rd without-exp exp-exp)
608+ ;~ plug
609+ (just '0')
610+ ::
611+ (mask "xX")
612+ ::
613+ (plus hex-digit)
614+ ::
615+ %- punt
616+ ;~ pfix
617+ dot
618+ (plus hex-digit)
619+ ==
620+ ::
621+ %- punt
622+ ;~ pfix
623+ (mask "pP")
624+ ;~(plug ;~(pose (cold | hep) (cold & lus) (easy &)) dim:ag)
625+ ==
626+ ==
627+ |%
628+ ++ hex-digit
629+ %+ knee *char
630+ |.
631+ ;~ pose
632+ (shim '0' '9')
633+ (shim 'a' 'f')
634+ (shim 'A' 'F')
635+ ==
636+ --
588637++ show-float
589638 |= x=@rd
590639 ^- tape