%longrealfn Real Constant
   {Input an encoded real constant and convert to M/C representation}
   %externallongrealfnspec Text to Floating %alias "3L___text_to_float" {-}%c
                                     (%string(255) S, %integer Exp)
   %integer Exp, J
   %longreal Value
   %string(255) S

   %on 1,4 %start
      %if Event_Event = 1 %start
         Fail("overflow while processing real constant")
      %else %if Event_Event=4
         Fail("error in real constant")
      %else
         Fail("Bad signal")
      %finish
   %finish

   S = "";  Exp = 0

   %for J = 1, 1, Tag %cycle        {gather the non-exponent part into S}
      %if Pending = '@' %start      {exponent marker}
         Readsymbol(Pending)        {skip the '@'}
         Exp = Tag                  {only 16 bits}
         Exp = Exp!16_FFFF8000 %if Exp&16_FFFF8000 # 0
         %exit
      %finish
      S = S.Tostring(Pending)
      Readsymbol(Pending)
   %repeat
   Value = Text to Floating(S, Exp)
   %if Pending = 'U' %start               {unary minus following}
      Value = -Value
      Readsymbol(Pending)                 {skip the 'U'}
   %finish
   %result = Value
%end
%endoffile
