Lazarus

Miscellaneous => Suggestions => Topic started by: coffee on October 01, 2022, 08:27:05 am

Title: Conversion StrToFloat
Post by: coffee on October 01, 2022, 08:27:05 am
Why is it StrToFloat instead of StrToReal? the data type declared is Real
What do you prefer guys? Im just curious why follow C languange :)
Title: Re: Conversion StrToFloat
Post by: marcov on October 01, 2022, 11:07:04 am
The Turbo Pascal era mostly said real. In Delphi time, the *float functions appeared.

Maybe real had gotten tainted because of real48, the emulated floating point type.

So yes, historical reasons. My guess would be that the terminology came from the FPU (x87) world, not necessarily C directly.
Title: Re: Conversion StrToFloat
Post by: Leledumbo on October 12, 2022, 11:35:46 am
I thought it was meant to be used alongside math unit's Float type, but apparently StrToFloat returns Extended instead, completely unrelated to math since sysutils itself doesn't use math.
TinyPortal © 2005-2018