Recent

Author Topic: Single to Extended how?  (Read 6747 times)

=sniper=

  • Guest
Single to Extended how?
« on: June 20, 2006, 11:26:51 am »
... Error: Illegal type conversion: "Single" to "Extended"
at line with
Code: [Select]
Extended(temp)
how to fix this?

Anonymous

  • Guest
RE: Single to Extended how?
« Reply #1 on: June 20, 2006, 11:34:23 am »
sorry.

Anonymous

  • Guest
RE: Single to Extended how?
« Reply #2 on: June 20, 2006, 11:37:56 am »
ah it compiles with {$MODE objfpc} but not in {$MODE Delphi} why?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2649
RE: Single to Extended how?
« Reply #3 on: June 20, 2006, 04:20:35 pm »
Casting is ugly and potentially dangerous.

You normally don't have to cast, assigning works:

var
  s: Single;
  e: extended;
begin
  s := 1.2;
  e := s;
end;
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Anonymous

  • Guest
RE: Single to Extended how?
« Reply #4 on: June 20, 2006, 08:51:16 pm »
I am porting game engine from Delphi to FPC %))

Anonymous

  • Guest
RE: Single to Extended how?
« Reply #5 on: June 20, 2006, 09:08:39 pm »
Thank you %)

 

TinyPortal © 2005-2018