mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-17 00:47:19 +02:00
* iso conformant writing of floats (using e instead of E) in iso mode
git-svn-id: trunk@15684 -
This commit is contained in:
parent
2d042aca6b
commit
c506913e9b
@ -446,6 +446,11 @@ implementation
|
||||
else
|
||||
begin
|
||||
name := procprefixes[do_read]+'float';
|
||||
|
||||
{ iso pascal needs a different handler due to upper/lower E differences }
|
||||
if (m_iso in current_settings.modeswitches) and not(do_read) then
|
||||
name:=name+'_iso';
|
||||
|
||||
readfunctype:=pbestrealtype^;
|
||||
end;
|
||||
end;
|
||||
|
@ -479,6 +479,7 @@ procedure fpc_write_text_int64(len : longint;var t : text;i : int64); compilerpr
|
||||
{$endif CPU64}
|
||||
{$ifndef FPUNONE}
|
||||
Procedure fpc_Write_Text_Float(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); compilerproc;
|
||||
Procedure fpc_Write_Text_Float_Iso(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); compilerproc;
|
||||
{$endif}
|
||||
procedure fpc_write_text_enum(typinfo,ord2strindex:pointer;len:sizeint;var t:text;ordinal:longint); compilerproc;
|
||||
{$ifdef FPC_HAS_STR_CURRENCY}
|
||||
|
@ -454,3 +454,15 @@ begin
|
||||
else s:=temp;
|
||||
end;
|
||||
|
||||
|
||||
Procedure str_real_iso (len,f : longint; d : ValReal; real_type :treal_type; out s : string);
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
str_real(len,f,d,real_type,s);
|
||||
for i:=1 to Length(s) do
|
||||
if s[i]='E' then
|
||||
s[i]:='e';
|
||||
end;
|
||||
|
||||
|
||||
|
@ -728,6 +728,17 @@ Begin
|
||||
Str_real(Len,fixkomma,r,treal_type(rt),s);
|
||||
Write_Str(Len,t,s);
|
||||
End;
|
||||
|
||||
|
||||
Procedure fpc_Write_Text_Float_iso(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); iocheck; compilerproc;
|
||||
var
|
||||
s : String;
|
||||
Begin
|
||||
If (InOutRes<>0) then
|
||||
exit;
|
||||
Str_real_iso(Len,fixkomma,r,treal_type(rt),s);
|
||||
Write_Str(Len,t,s);
|
||||
End;
|
||||
{$endif}
|
||||
|
||||
procedure fpc_write_text_enum(typinfo,ord2strindex:pointer;len:sizeint;var t:text;ordinal:longint); iocheck; compilerproc;
|
||||
|
Loading…
Reference in New Issue
Block a user