Sage-ST ä

Convertreal

Documentation

EvaluateSciFloat LongRealToStr RealToStr RoundAndTrimSciFloat
STREvaluateSciFloat STRLongRealToStr STRRealToStr STRRoundAndTrimSciFloat
STRStrToLongReal STRStrToReal StrToLongReal StrToReal




  procedure StrToReal
             (const Str     : array of char;
              var   RealVal : ModSys.FLOAT32;
              var   Success : boolean); overload; stdcall;

  exports StrToReal (const Str     : array of char;
                     var   RealVal : ModSys.FLOAT32;
                     var   Success : boolean) name 'ConvertReal_StrToReal';




  procedure StrToReal
             (const Str     : string;
              var   RealVal : ModSys.FLOAT32;
              var   Success : boolean); overload; stdcall;

  exports StrToReal (const Str     : string;
                     var   RealVal : ModSys.FLOAT32;
                     var   Success : boolean) name 'ConvertReal_STRStrToReal';




  procedure RealToStr
             (const RealVal : ModSys.FLOAT32;
              var   Str     : array of char;
              const width   : integer;
              const digits  : integer;
              var   Success : boolean); overload; stdcall;

  exports RealToStr (const RealVal : ModSys.FLOAT32;
                     var   Str     : array of char;
                     const width   : integer;
                     const digits  : integer;
                     var   Success : boolean) name 'ConvertReal_RealToStr';

  //*
  //  RealToStr - Convert Real to string, can be a fixed size.
  //
  //  This procedure converts a single into a string that represents the
  //  number.  There are two modes of using this routine.  If the value of
  //  width is equal to 0 then the value is converted to string in a free
  //  format.  If the value of width is greater than 0 the string is converted
  //  in a fixed format.
  //
  //  Free format - If the value of width is 0 then this format is used.  This
  //  results in a string that is always left justified and only shows the sign
  //  position if the number is negative.  In this mode the only constraint to
  //  converting is the size of the string that was passed in.
  //
  //  Fixed format - If the value of width is greater than 0 then this format is
  //  used.  In this mode the value is converted to a total length that equals
  //  the size of width.  NOTE - The value of width INCLUDES the sign character
  //  if the number is negative (i.e. the value of -100.0 requires a width of 6).
  //  If the value is positive it can completely fill the string (i.e. a width
  //  of 6 can handle a positive value up to 9999.9).
  //
  //  If the string passed is shorter than width or if the converted value will
  //  not fit within the length of the string then SageError #16
  //  (SageErrs.ArrayTooSmall) is generated.
  //




  procedure RealToStr
             (const RealVal : ModSys.FLOAT32;
              var   Str     : string;
              const width   : integer;
              const digits  : integer;
              var   Success : boolean); overload; stdcall;

  exports RealToStr (const RealVal : ModSys.FLOAT32;
                     var   Str     : string;
                     const width   : integer;
                     const digits  : integer;
                     var   Success : boolean) name 'ConvertReal_STRRealToStr';

  //*
  //  STRRealToStr - See documentation of RealToStr.
  //




  procedure StrToLongReal
             (const Str     : array of char;
              var   RealVal : ModSys.FLOAT64;
              var   Success : boolean); overload; stdcall;

  exports StrToLongReal (const Str     : array of char;
                         var   RealVal : ModSys.FLOAT64;
                         var   Success : boolean) name 'ConvertReal_StrToLongReal';




  procedure StrToLongReal
             (const Str     : string;
              var   RealVal : ModSys.FLOAT64;
              var   Success : boolean); overload; stdcall;

  exports StrToLongReal (const Str     : string;
                         var   RealVal : ModSys.FLOAT64;
                         var   Success : boolean) name 'ConvertReal_STRStrToLongReal';




  procedure LongRealToStr
             (const RealVal : ModSys.FLOAT64;
              var   Str     : array of char;
              const width   : integer;
              const digits  : integer;
              var   Success : boolean); overload; stdcall;

  exports LongRealToStr (const RealVal : ModSys.FLOAT64;
                         var   Str     : array of char;
                         const width   : integer;
                         const digits  : integer;
                         var   Success : boolean) name 'ConvertReal_LongRealToStr';

  //*
  //  LongRealToStr - Convert LongReal to string, can be a fixed size.
  //
  //  This procedure converts a real into a string that represents the
  //  number.  There are two modes of using this routine.  If the value of
  //  width is equal to 0 then the value is converted to string in a free
  //  format.  If the value of width is greater than 0 the string is converted
  //  in a fixed format.
  //
  //  Free format - If the value of width is 0 then this format is used.  This
  //  results in a string that is always left justified and only shows the sign
  //  position if the number is negative.  In this mode the only constraint to
  //  converting is the size of the string that was passed in.
  //
  //  Fixed format - If the value of width is greater than 0 then this format is
  //  used.  In this mode the value is converted to a total length that equals
  //  the size of width.  NOTE - The value of width INCLUDES the sign character
  //  if the number is negative (i.e. the value of -100.0 requires a width of 6).
  //  If the value is positive it can completely fill the string (i.e. a width
  //  of 6 can handle a positive value up to 9999.9).
  //
  //  If the string passed is shorter than width or if the converted value will
  //  not fit within the length of the string then SageError #16
  //  (SageErrs.ArrayTooSmall) is generated.
  //




  procedure LongRealToStr
             (const RealVal : ModSys.FLOAT64;
              var   Str     : string;
              const width   : integer;
              const digits  : integer;
              var   Success : boolean); overload; stdcall;

  exports LongRealToStr (const RealVal : ModSys.FLOAT64;
                         var   Str     : string;
                         const width   : integer;
                         const digits  : integer;
                         var   Success : boolean) name 'ConvertReal_STRLongRealToStr';

  //*
  //  STRLongRealToStr - See documentation of LongRealToStr.
  //




  procedure EvaluateSciFloat
             (const Value              : array of char;
              var   NumPreDecimal      : cardinal;
              var   NumPostDecimal     : cardinal;
              var   NumInExponent      : cardinal;
              var   PreSignIsPositive  : boolean;
              var   PostSignIsPositive : boolean;
              var   ePosition          : cardinal;
              var   InvalidChars       : boolean); overload; stdcall;

  exports EvaluateSciFloat (const Value              : array of char;
                            var   NumPreDecimal      : cardinal;
                            var   NumPostDecimal     : cardinal;
                            var   NumInExponent      : cardinal;
                            var   PreSignIsPositive  : boolean;
                            var   PostSignIsPositive : boolean;
                            var   ePosition          : cardinal;
                            var   InvalidChars       : boolean) name 'ConvertReal_EvaluateSciFloat';

  //*
  //  EvaluateSciFloat - Parse the SciFloat to count sizes.
  //
  //  This procedure parses a supposedly SciFloat format alpha string
  //  and returns the information about how it is composed.  If
  //  invalid characaters are encounted it reports that alos.
  //
  //  CALLING SEQUENCE -
  //
  //    EvaluateSciFloat (Value, NumPreDecimal, NumPostDecimal,
  //                      NumInExponent, PreSignIsPositive,
  //                      PostSignIsPositive, EPosition, InvalidChars)
  //
  //  ENTRY -
  //
  //    Value : array of char
  //      The string containing the SciFloat format value.
  //
  //  EXIT -
  //
  //    NumPreDecimal : cardinal
  //      The number of digits found before the decimal place.  This does
  //      NOT include the sign character.
  //
  //    NumPostDecimal : cardinal
  //      The number of digits found after the decimal place and before the
  //      'E' character.  This does NOT include that character.
  //
  //    NumInExponent : cardinal
  //      The number of digits found in the exponent position NOT including
  //      the sign position.
  //
  //    PreSignIsPositive : boolean
  //      True - The pre-decimal sign is positive.
  //      False - The pre-decimal sign is negative.
  //
  //    PostSignIsPositive : boolean
  //      True - The post-decimal sign is positive.
  //      False - The post-decimal sign is negative.
  //
  //    EPosition : cardinal
  //      The position in the string where the E character is found.
  //
  //    InvalidChars : boolean
  //      TRUE - Invalid charaters for this format encounted.
  //      FALSE - All characters valid in their respecitve positions.
  //




  procedure EvaluateSciFloat
             (const Value              : string;
              var   NumPreDecimal      : cardinal;
              var   NumPostDecimal     : cardinal;
              var   NumInExponent      : cardinal;
              var   PreSignIsPositive  : boolean;
              var   PostSignIsPositive : boolean;
              var   ePosition          : cardinal;
              var   InvalidChars       : boolean); overload; stdcall;

  exports EvaluateSciFloat (const Value              : string;
                            var   NumPreDecimal      : cardinal;
                            var   NumPostDecimal     : cardinal;
                            var   NumInExponent      : cardinal;
                            var   PreSignIsPositive  : boolean;
                            var   PostSignIsPositive : boolean;
                            var   ePosition          : cardinal;
                            var   InvalidChars       : boolean) name 'ConvertReal_STREvaluateSciFloat';

  //*
  //  STREvaluateSciFloat - See documentation of EvaluateSciFloat.
  //




  procedure RoundAndTrimSciFloat
             (const NumDecimalDigits : cardinal;
              var   SciAlphaVal      : array of char); overload; stdcall;

  exports RoundAndTrimSciFloat (const NumDecimalDigits : cardinal;
                                var   SciAlphaVal      : array of char) name 'ConvertReal_RoundAndTrimSciFloat';

  //*
  //  RoundAndTrimSciFloat - Round and trim SciFloat value in the post decimal chars.
  //
  //  This procedure checks and rounds the post decimal positions of a SciFloat
  //  format string.  After trimming the string should be correctly rounded and
  //  trimmed to only allow NumDecimalDigits of characters following the
  //  decimal point and preceeding the 'E' character.
  //
  //  CALLING SEQUENCE -
  //
  //    RoundAndTrimSciFloat (NumDecimalDigits, SciAlphaVal)
  //
  //  ENTRY -
  //
  //    NumDecimalDigites : cardinal
  //      The final allowable number of post decimal digits to retain.
  //
  //  EXIT -
  //
  //    SciAlphaVal : array of char
  //      The string representing the correct rounded and trimmed value of the
  //      floating point number.
  //




  procedure RoundAndTrimSciFloat
             (const NumDecimalDigits : cardinal;
              var   SciAlphaVal      : string); overload; stdcall;

  exports RoundAndTrimSciFloat (const NumDecimalDigits : cardinal;
                                var   SciAlphaVal      : string) name 'ConvertReal_STRRoundAndTrimSciFloat';

  //*
  //  STRRoundAndTrimSciFloat - See documentation of RoundAndTrimSciFloat.
  //




Send mail to   warren.merrill@inl.gov with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance