Jump to content

Leif Uneus

Members
  • Content Count

    75
  • Joined

  • Last visited

Posts posted by Leif Uneus


  1. @dummzeuch and @Rollo62

     

    No matter if you use '123.4' or '123,4'. It gives error in position 4 with a result of 123.

     

    Oops, my bad.

     

    Indeed when a float is passed, '123.4' results in 123.4 with error = 0, while '123,4' results in 123 with error = 4.

     

    There must be an error in the docs:

    Quote

    Other than the optional sign at the beginning, all characters must be digits; decimal or thousands separators are not supported.

    Though one sentence later it says:

    Quote

    V is an integer-type or real-type variable. If V is an integer-type variable, S must form a whole number.

    Which implies that a real type must not be a whole number.

     


  2. 18 hours ago, Anders Melander said:

    BS indeed.

    Borland/Delphi was never any threat to Microsoft and certainly not to their Windows division. It would actually have been counter productive for the Windows division to sabotage any Windows application.

    - and they didn't "steal" Anders Hejlsberg or hire him to hurt Borland. They wanted his talent and he went by his own choice and for his own reasons. Borland didn't own him and if they got hurt by his departure that was their own fault.

    Borland filed a lawsuite against Microsoft at the time of Hejlsberg's departure though.

    See https://www.wsj.com/articles/SB863034062733665000 

     

    >Borland Charges Microsoft Stole Away Its Employees

     


  3. 2 hours ago, Attila Kovacs said:

    @Leif Uneus Wow, thanks a lot, and also to LU RD if he ever reads this.

    Well. there is no secret that LU RD is short for Leif Uneus R&D Manager of Opsis AB, a company that provides analysers and software for industrial and environmental analysis of gases and particulates.

    A company started 36 years ago by me and my business partner.

     

    Core software in the analysers is built with Turbo Pascal 7. Delphi is a tool for our software for data management, analysis and reporting.

    • Like 1

  4. 1 hour ago, David Heffernan said:

    Which would appear to provide a way to specify the type of floating point literal when the value is not exactly representable.

     

    The type is still extended, but the value will be as a single(0.1)

     

    program Project169;
    {$APPTYPE CONSOLE}
    uses
      System.SysUtils, System.TypInfo;
    
    type
      TTypeInfo = class
        class function ShowTypeInfo<T>(const X: T) : String;
      end;
    
    class function TTypeInfo.ShowTypeInfo<T>(const X: T) : String;
    var
      LTypeInfo: PTypeInfo;
    begin
      LTypeInfo := TypeInfo(T);
      Result := LTypeInfo.Name;
    end;
    
    const
      F1 : Single = 0.1;
      F2 = Single(0.1);    // <- Extended type, with the value of a single 0.1
      F3 = Extended(0.1);
    
    begin
      WriteLn(TTypeInfo.ShowTypeInfo(F1):10,':',F1);
      WriteLn(TTypeInfo.ShowTypeInfo(F2):10,':',F2);
      WriteLn(TTypeInfo.ShowTypeInfo(F3):10,':',F3);
      ReadLn;
    end.

    Outputs:

     

        Single: 1.00000001490116E-0001
      Extended: 1.00000001490116E-0001
      Extended: 1.00000000000000E-0001

     

×